#PB_Button_Default not set

Mac OSX specific forum
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

#PB_Button_Default not set

Post by michel51 »

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
WilliamL
Addict
Addict
Posts: 1252
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: [5.00B2] #PB_Button_Default not set

Post 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
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
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [5.00B2] #PB_Button_Default not set

Post 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.
Post Reply