Button don't do anything
What am I missing here ?
OS: Windows.
gui by form designer
Code: Select all
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Enumeration FormWindow
#gui
EndEnumeration
Enumeration FormGadget
#button
EndEnumeration
Declare button(EventType)
Procedure Opengui(x = 0, y = 0, width = 600, height = 400)
OpenWindow(#gui, x, y, width, height, "Just a test", #PB_Window_SystemMenu)
ButtonGadget(#button, 160, 90, 100, 25, "Click me")
EndProcedure
Procedure gui_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #button
button(EventType())
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
Code: Select all
XIncludeFile "testgui.pbf"
opengui()
Procedure button(EventType)
MessageRequester("Information", "Click to close", 0)
EndProcedure
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow
Quit = 1
EndIf
Until Quit = 1
End