mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-17 18:12:01 +01:00
use Ftr for globals rather than gadget
This commit is contained in:
parent
8a83f36368
commit
3b5222d5f6
1 changed files with 8 additions and 13 deletions
|
@ -337,27 +337,22 @@ penInGadget( EventPtr event, UInt16* whichGadget )
|
||||||
return result;
|
return result;
|
||||||
} /* penInGadget */
|
} /* penInGadget */
|
||||||
|
|
||||||
|
#define GLOBALS_FEATURE 10
|
||||||
void
|
void
|
||||||
setFormRefcon( void* refcon )
|
setFormRefcon( void* refcon )
|
||||||
{
|
{
|
||||||
UInt16 index;
|
Err err = FtrSet( APPID, GLOBALS_FEATURE, refcon );
|
||||||
FormPtr form = FrmGetFormPtr( XW_MAIN_FORM );
|
XP_ASSERT( err == errNone );
|
||||||
XP_ASSERT( !!form );
|
|
||||||
index = FrmGetObjectIndex( form, REFCON_GADGET_ID );
|
|
||||||
FrmSetGadgetData( form, index, refcon );
|
|
||||||
} /* setFormRefcon */
|
} /* setFormRefcon */
|
||||||
|
|
||||||
void*
|
void*
|
||||||
getFormRefcon()
|
getFormRefcon()
|
||||||
{
|
{
|
||||||
void* result = NULL;
|
UInt32 ptr;
|
||||||
FormPtr form = FrmGetFormPtr( XW_MAIN_FORM );
|
Err err = FtrGet( APPID, GLOBALS_FEATURE, &ptr );
|
||||||
|
XP_ASSERT( err == errNone );
|
||||||
if ( !!form ) {
|
XP_ASSERT( ptr != 0L );
|
||||||
UInt16 index = FrmGetObjectIndex( form, REFCON_GADGET_ID );
|
return (void*)ptr;
|
||||||
result = FrmGetGadgetData( form, index );
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} /* getFormRefcon */
|
} /* getFormRefcon */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue