voila je voudrais savoir comment je peux programmer le bouton quitter
pour que l'utilisateur quitte de le programme
Code : Tout sélectionner
Enumeration
#Window_0
#Window_1
EndEnumeration
Enumeration
#MenuBar_0
EndEnumeration
Enumeration
#MENU_1
EndEnumeration
Enumeration
#Button_Quitter
EndEnumeration
Enumeration
#Button_0
#Text_0
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 257, 162, 602, 302, #PB_Window_SystemMenu | #PB_Window_TitleBar | #PB_Window_ScreenCentered, "Test")
If CreateGadgetList(WindowID())
ButtonGadget(#Button_Quitter, 230, 210, 120, 50, "Quitter")
If CreateMenu(#MenuBar_0, WindowID())
MenuTitle("?")
MenuItem(#MENU_1, "A propos")
EndIf
EndIf
EndIf
EndProcedure
Procedure Open_Window_1()
If OpenWindow(#Window_1, 295, 192, 251, 216, #PB_Window_SystemMenu | #PB_Window_TitleBar, "A propos")
If CreateGadgetList(WindowID())
ButtonGadget(#Button_0, 190, 180, 50, 30, "OK", #PB_Button_Default)
TextGadget(#Text_0, 110, 50, 60, 20, "PureBasic!")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_EventCloseWindow
Fenetre = EventWindowID()
If fenetre = #Window_1
Fermer_Window_1 = 1 ;s
EndIf
Case #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Button_0
Fermer_Window_1 = 1
EndIf
EndSelect
Until Fermer_Window_1 = 1
CloseWindow(#Window_1)
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_EventMenu
MenuID = EventMenuID()
If MenuID = #MENU_1
Open_Window_1()
EndIf
Case #PB_EventCloseWindow
Fenetre = EventWindowID()
If fenetre = #Window_0
Fermer_Window_0 = 1
EndIf
EndSelect
Until Fermer_Window_0 = 1
End
merci de m'aider