Hilight button in CoCo

Mac OSX specific forum
spacebuddy
Enthusiast
Enthusiast
Posts: 364
Joined: Thu Jul 02, 2009 5:42 am

Hilight button in CoCo

Post by spacebuddy »

is there any way to highlight a button compiling to coco using x86.?

Thanks
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3944
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Hilight button in CoCo

Post by wilbert »

In 5.1 you can use the CocoaMessage command to do something like that.
If you want to toggle a button, you can use SetGadgetState().
User avatar
Shardik
Addict
Addict
Posts: 2076
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Hilight button in CoCo

Post by Shardik »

spacebuddy wrote:is there any way to highlight a button compiling to coco using x86.?
For PB 5.10 (x86 or x64):

Code: Select all

Procedure HighlightButton(WindowID, GadgetID)
  CocoaMessage(0, WindowID(WindowID), "setDefaultButtonCell:", CocoaMessage(0, GadgetID(GadgetID), "cell"))
EndProcedure

OpenWindow(0, 270, 100, 200, 95, "ButtonGadgets")
ButtonGadget(0, 20, 20, 160, 25, "Standard Button")
ButtonGadget(1, 20, 55, 160, 25, "Highlighted Button")
HighlightButton(0, 1)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Fred
Administrator
Administrator
Posts: 18499
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Hilight button in CoCo

Post by Fred »

I think than #PB_Button_Default flag should work as well.
User avatar
Shardik
Addict
Addict
Posts: 2076
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Hilight button in CoCo

Post by Shardik »

Fred wrote:I think than #PB_Button_Default flag should work as well.
That's right and it doesn't require API at all. Sorry that I overlooked this... :oops:

Code: Select all

OpenWindow(0, 270, 100, 200, 95, "ButtonGadgets")
ButtonGadget(0, 20, 20, 160, 25, "Standard Button")
ButtonGadget(1, 20, 55, 160, 25, "Highlighted Button", #PB_Button_Default)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Post Reply