Here are more examples from wilbert to disable/enable scrollbars, make a button a default button (any size!), and right justify a string gadget.
Code:
#NSRoundedBezelStyle = 1 ; for default button
#NSRightTextAlignment = 1 ; for right align string gadget
If OpenWindow(0, 0, 0, 270, 260, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0, 10, 10, 250, 180)
For a = 1 To 12
AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview")
Next
ButtonGadget(1, 10, 200, 80, 30, "Button")
StringGadget(2, 10,230,120,22,"String gadget")
; alternating colors
CocoaMessage(0,GadgetID(0),"setUsesAlternatingRowBackgroundColors:",#True)
; enable/disable scrollers
ScrollView = CocoaMessage(0,GadgetID(0),"enclosingScrollView")
CocoaMessage(0,ScrollView,"setHasVerticalScroller:", #False) ; "setHasHorizontalScroller:"
; set default button cell
ButtonCell = CocoaMessage(0,GadgetID(1),"cell")
CocoaMessage(0,GadgetID(1),"setBezelStyle:", #NSRoundedBezelStyle)
CocoaMessage(0,WindowID(0),"setDefaultButtonCell:", ButtonCell)
;set string gadget to right-justified
CocoaMessage(0,GadgetID(2),"setAlignment:", #NSRightTextAlignment)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf