I have the following simple menu to call a procedure:
Code: Select all
Enumeration
#MAIN_WINDOW
#MAIN_BUTTON_EXIT
#MAIN_BUTTON_0
#FLAGS = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
EndEnumeration
Procedure Button_0()
x = 1
Debug x
EndProcedure
Procedure MainWindow()
OpenWindow(#MAIN_WINDOW, 0, 0, 300, 200, "Main Window", #FLAGS)
ButtonGadget(#MAIN_BUTTON_EXIT,230,180,70,20,"Quit")
ButtonGadget(#MAIN_BUTTON_0,60,80,175,40,"Run Procedure with Button_0")
Repeat ; main program loop
MainWindowLoop = WindowEvent()
Select EventGadget() ; this is apparently needed to make the button do stuff!
Case #MAIN_BUTTON_0
Button_0()
Case #MAIN_BUTTON_EXIT
Quit = #True
EndSelect
Until MainWindowLoop = #PB_Event_CloseWindow Or Quit = #True
EndProcedure
MainWindow()
Code: Select all
1
1
Can someone enlighten me? I am running v5.70. Thanks!