Voici un exemple de source.
Code : Tout sélectionner
;{- Enumerations / DataSections
;{ Windows
a$ = "a:\"
c$ = "c:\"
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#ExplorerList_0
#Button_1
#Button_2
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 450, 200, 400, 238, "Test.", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
If CreateGadgetList(WindowID(#Window_0))
ExplorerListGadget(#ExplorerList_0, 0, 0, 390, 195, "c:\")
ButtonGadget(#Button_1, 5, 200, 150, 20, "A:")
ButtonGadget(#Button_2, 160, 200, 150, 20, "C:")
EndIf
EndIf
EndProcedure
OpenWindow_Window_0()
;{- Event loop
Repeat
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #ExplorerList_0
ElseIf EventGadget = #Button_1
SetGadgetText(#ExplorerList_0, a$)
ElseIf EventGadget = #Button_2
SetGadgetText(#ExplorerList_0, c$)
EndIf
; ////////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
;
;}