C'est de pire en pire, je trouve
Code : Tout sélectionner
; PureBasic Visual Designer v3.92 build 1460
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Button_0
#Button_1
#Button_2
#Button_3
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 364, 52, 190, 226, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "New window ( 0 )")
If CreateGadgetList(WindowID())
ButtonGadget(#Button_0, 5, 5, 180, 50, "")
ButtonGadget(#Button_1, 5, 60, 180, 50, "")
ButtonGadget(#Button_2, 5, 115, 180, 50, "")
ButtonGadget(#Button_3, 5, 170, 180, 50, "")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat ; Start of the event loop
;**************** C'est quoi ce bazar ??????????
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindowID() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadgetID() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
;*************** N'importe quoi !
If Event = #PB_EventGadget
If GadgetID = #Button_0
ElseIf GadgetID = #Button_1
ElseIf GadgetID = #Button_2
ElseIf GadgetID = #Button_3
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;
Quand est-ce qu'on va enfin avoir le choix entre les "If/Endif" et les "Select/Case" ???
