But on Mac, the “in between” state is also selectable by the user (on Windows it is as described in the help).The #PB_Tree_ThreeState flag can be used in combination with the #PB_Tree_CheckBoxes flag to get checkboxes that can have an "on", "off" and "in between" state. The user can only select the "on" or "off" states. The "in between" state can be set programmatically using the SetGadgetItemState() function.
Is this an error in the help file or a bug in PB?
My system:
MacBook Pro with M1 Pro, Sonoma 14.12, BT Keyboard MX MCHNCL, Purebasic 6.04LTS
Code: Select all
EnableExplicit
#wndMain = 0
#tree = 0
Define a.i
If OpenWindow(#wndMain, 0, 0, 400, 300, "TreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TreeGadget(#tree, 0, 0, 400, 300, #PB_Tree_CheckBoxes | #PB_Tree_ThreeState)
For a = 0 To 10
AddGadgetItem(#tree, -1, "Normal Item "+Str(a), 0, 0)
AddGadgetItem(#tree, -1, "Node "+Str(a), 0, 0)
AddGadgetItem(#tree, -1, "Sub-Item 1", 0, 1)
AddGadgetItem(#tree, -1, "Sub-Item 2", 0, 1)
AddGadgetItem(#tree, -1, "Sub-Item 3", 0, 1)
AddGadgetItem(#tree, -1, "Sub-Item 4", 0, 1)
AddGadgetItem(#tree, -1, "File "+Str(a), 0, 0)
Next
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf