#PB_Button_Default not set
#PB_Button_Default not set
If I use the flag "#PB_Button_Default" with ButtonGadget(), the button is NOT set to default.
michel51
Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
Re: [5.00B2] #PB_Button_Default not set
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:
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
Last edited by WilliamL on Tue Sep 18, 2012 3:21 am, edited 1 time in total.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Re: [5.00B2] #PB_Button_Default not set
It does work only with an height of 25 (then it uses standard OS X button, which are fixed height). The help is updated.