use Ftr for globals rather than gadget

This commit is contained in:
ehouse 2004-09-23 02:19:04 +00:00
parent 8a83f36368
commit 3b5222d5f6

View file

@ -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