Someone told me on another forum that PB controls are not native so they are useless???
Not sure what that means

Most of PB's gadgets are native controls. Some PB gadgets don't exist as a native cocoa control (for example the ExplorerTreeGadget is a custom gadget programmed by the PB devs using another native cocoa control to emulate more or less the functions working natively on other OS platforms). You can easily find out what native cocoa controls are hidden behind PB's gadgets. Wilbert has already demonstrated how to find out the underlying objects of a cocoa control (for the MacOS Carbon framework, for Windows and for Linux all underlying native controls are listed in this PB blog posting).spacebuddy wrote:Are all the Gadgets in PB native controls for OS/X?
Code: Select all
Procedure.S GetInheritedObjects(Object)
Protected Result.I
Protected MutableArray.I = CocoaMessage(0, 0, "NSMutableArray arrayWithCapacity:", 10)
Repeat
CocoaMessage(0, MutableArray, "addObject:", CocoaMessage(0, Object, "className"))
CocoaMessage(@Object, Object, "superclass")
Until Object = 0
CocoaMessage(@Result, MutableArray, "componentsJoinedByString:$", @" --> ")
CocoaMessage(@Result, Result, "UTF8String")
ProcedureReturn PeekS(Result, -1, #PB_UTF8)
EndProcedure
OpenWindow(0, 270, 100, 390, 80, "ComboBoxGadget")
ComboBoxGadget(0, 10, 10, 180, 25, #PB_ComboBox_Editable)
ComboBoxGadget(1, 200, 10, 180, 25)
For i = 1 To 3
AddGadgetItem(0, -1, "Item " + Str(i))
AddGadgetItem(1, -1, "Item " + Str(i))
Next i
SetGadgetState(0, 0)
SetGadgetState(1, 0)
Debug "Editable ComboBox: " + GetInheritedObjects(GadgetID(0))
Debug "Uneditable ComboBox: " + GetInheritedObjects(GadgetID(1))
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindowCode: Select all
Procedure.S GetInheritedObjects(Object)
Protected Result.I
Protected MutableArray.I = CocoaMessage(0, 0, "NSMutableArray arrayWithCapacity:", 10)
Repeat
CocoaMessage(0, MutableArray, "addObject:", CocoaMessage(0, Object, "className"))
CocoaMessage(@Object, Object, "superclass")
Until Object = 0
CocoaMessage(@Result, MutableArray, "componentsJoinedByString:$", @" --> ")
CocoaMessage(@Result, Result, "UTF8String")
ProcedureReturn PeekS(Result, -1, #PB_UTF8)
EndProcedure
OpenWindow(0, 270, 100, 400, 400, "Test")
ExplorerTreeGadget(0, 10, 10, 380, 380, "/Volumes/Daten/")
Debug "ExplorerTreeGadget: " + GetInheritedObjects(GadgetID(0))
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow