

#PB_Event_MinimizeWindow : the window has been minimized #PB_Event_MoveWindow : the window has been moved

#PB_Event_SizeWindow : the window has been resized #PB_Event_Repaint : the window content has been destroyed and must be repainted (useful for 2D graphics operations) #PB_Event_CloseWindow : the window close gadget has been pushed #PB_Event_Timer : a timer has reached its timeout #PB_Event_SysTray : an icon in the systray zone was clicked #PB_Event_Gadget : a gadget has been pushed #PB_Event_Menu : a menu has been selected To get the window number in which the event occurred, use the EventWindow() function. In this case, either Delay() shouldīe used somewhere in the loop or WaitWindowEvent() with a small timeout value. WaitWindowEvent(), it will not give CPU time to other programs while waitingįor an event and therefore consume all CPU power. It must be handled with care though if used on a continuing basis, because unlike This makes it useful for window event loops, where other processing needs to be done without waitingįor an event to happen (e.g.

Unlike WaitWindowEvent() it doesn't wait for the next event - it always returns immediately. The next event from the event queue and or zero if there are no more events. RemoveGadgetItem(4, GetGadgetState(4)) Remove the current element of the ListViewChecks if an event has occurred on any of the opened windows. SetGadgetText(0, GetGadgetText(4)) Get the current item from the ListView.ĪddGadgetItem(4, -1, "New Item Added.") MessageRequester("Info", "Return key pressed", 0)ĭisableGadget(2,0) Enable the 'Stop' gadgetĭisableGadget(1,1) Disable the 'Play' GadgetĭisableGadget(1,0) Enable the 'Play' gadgetĭisableGadget(2,1) Disable the 'Stop' Gadget GadgetToolTip(7, "Select the current song") WindowBounds(0, #WindowWidth, #WindowHeight, #PB_Default, #PB_Default)įrameGadget(99, 10, Top, 370, 290, "Player.") : Top+20 If OpenWindow(0, 100, 200, #WindowWidth, #WindowHeight, "PureBasic - Gadget Demonstration", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget) Set the AutoresizingMask for the GadgetĬocoaMessage(0,tmp, "setAutoresizingMask:", value) This is the "CatchAll" for typical PBGadgets Tmp = GadgetID(handle) Live Gadget Auto Resizing Demo This will cause the image to scale proportionallyĬocoaMessage(0,GadgetID(handle),"setImageScaling:",1) Tmp = CocoaMessage(0, GadgetID(handle),"enclosingScrollView") So we have to retrieve the actual NSScrollView object to resize THE GADGETS ABOVE ARE COMPOSED OF PBGADGET->NSCLIPVIEW->NSSCROLLVIEW HIERARCHY #akFull = #akWidth | #akHeight resize width/height of Gadget, based on width/height of WindowĬase #PB_GadgetType_Editor, #PB_GadgetType_ListView, #PB_GadgetType_ListIcon, #PB_GadgetType_Tree #akHeight = 16 resize height of Gadget, based on height of Window #akTop = 8 anchor RELATIVE to top of Window, no resize #akLeft = 4 anchor to left side of Window, no resize #akWidth resize width of Gadget, based on width of Window #akRight anchor to right side of Window, no resize
