Page 1 of 1

#PB_Button_Default not set

Posted: Wed Sep 05, 2012 6:49 pm
by michel51
If I use the flag "#PB_Button_Default" with ButtonGadget(), the button is NOT set to default.

Re: [5.00B2] #PB_Button_Default not set

Posted: Wed Sep 05, 2012 7:40 pm
by WilliamL
I can't get the #PB_Button_Default to work either.

wilbert has provided this code to do the same thing with API and using his library:

Code: Select all

;with library
#NSRoundedBezelStyle = 1
If OpenWindow(0, 0, 0, 270, 240, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ButtonGadget(1, 10, 200, 80, 30, "Button")
 
    ; set default button cell
    ButtonCell = CocoaMessage(0,GadgetID(1),"cell")
    CocoaMessage(0,GadgetID(1),"setBezelStyle:", #NSRoundedBezelStyle)
    CocoaMessage(0,WindowID(0),"setDefaultButtonCell:", ButtonCell)
      
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf

Re: [5.00B2] #PB_Button_Default not set

Posted: Mon Sep 17, 2012 11:00 am
by Fred
It does work only with an height of 25 (then it uses standard OS X button, which are fixed height). The help is updated.