Re: sethandler() help please

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi,
the reason you are having trouble is that a call to routine_id must appear 
(not execute) after the routine it is gettting the ID for.

By the way, this is an interesting way to do this effect. I normally do 
this differently but your way is quite a novel approach that should work 
fine.

Any how you need to make these few changes...

Add this to near the top of the file...

   integer r_Close, r_Save

Then change the save_off/save_on routine thus...

   procedure save_off()
   setText(Save_Button, "Close")
   setHandler(Save_Button, w32HClick, {-1,r_Close}) --<< NB
   hl = getHandler(Save_Button, w32HClick)
   addItem( Product_List, hl )
   end procedure

   procedure save_on()
   setText(Save_Button, "Save")
   setHandler(Save_Button, w32HClick, {-1,r_Save}) --<< NB
   addItem( Product_List, "Save On" )
   end procedure

and finally, just prior to the WinMain() call add these lines ...

   r_Close = routine_id("Close_Button_onClick")
   r_Save = routine_id("Save_Button_onClick")

This seems to work fine.

-- 
Derek



-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu