Re: [Plib-users] pui help
Brought to you by:
sjbaker
From: Brian S. <sch...@ho...> - 2004-04-08 01:33:05
|
>Brian Smith wrote: >>Bruce: >> Your right!! i didn't even realize that, how then would I create this >>object as a global variable, in my header file I just have puOneShot >>*backButton; to make it global, then when it gets to createTeamButtons() >>it does create a new one (why the address was different between the >>backButton created and the backButton called to hide). However if I put >>this line in the header file >>puOneShot *backButton = new puOneShot (20.0, 20.0, 170.0, 50.0); >> >>I get a fatal error before anything starts up saying >> >>FATAL: puiGetWindow: callbacks are not initialized >> >>I'm guessing this is so because at the time of the .h file I have not >>initialized pui yet. So how would I create a global object?? > >At the top of your program: > >puOneShot *backButton = NULL ; > >...then somewhere *AFTER* puInit() but *BEFORE* you go into your main >processing loop: > > backButton = new puOneShot ( ...whatever... ) ; > >If you are feeling cautious, then in your callback, you can put: > > assert ( backButton != NULL ) ; thanks bruce and steve everything is working good, I appreciate it _________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.com/go/onm00200413ave/direct/01/ |