#PB_Button_Right + #PB_Button_Left work for toggle buttons
Posted: Tue May 10, 2011 8:01 pm
Although the PB help for Mac states:
#PB_Button_Toggle. The reason is that ButtonGadgets without the flag
#PB_Button_Toggle are internally Mac PushButtons which don't support text
justification. But ButtonGadgets with the flag #PB_Button_Toggle are internally
BevelButtons which support text justification (and in contrast to the help this
is even implemented in PB!). As a proof execute the following example code:
it is possible without problems to justify text in ButtonGadgets with the flagPB help for ButtonGadget wrote: #PB_Button_Right : Aligns the button text at the right. (not supported on Mac OSX)
#PB_Button_Left : Aligns the button text at the left. (not supported on Mac OSX)
#PB_Button_Toggle. The reason is that ButtonGadgets without the flag
#PB_Button_Toggle are internally Mac PushButtons which don't support text
justification. But ButtonGadgets with the flag #PB_Button_Toggle are internally
BevelButtons which support text justification (and in contrast to the help this
is even implemented in PB!). As a proof execute the following example code:
Code: Select all
OpenWindow(0, 200, 100, 222, 100, "ButtonGadgets")
ButtonGadget(0, 10, 10, 200, 20, "Standard Toggle Button", #PB_Button_Toggle)
ButtonGadget(1, 10, 40, 200, 20, "Left justified Toggle Button", #PB_Button_Toggle | #PB_Button_Left)
ButtonGadget(2, 10, 70, 200, 20, "Right justified Toggle Button", #PB_Button_Toggle | #PB_Button_Right)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow