Explorerlistgadget

Just starting out? Need help? Post your questions and find answers here.
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 183
Joined: Thu Dec 28, 2023 9:04 pm

Explorerlistgadget

Post by rndrei »

How do I find the name of the selected file?

Code: Select all

   Select EventType()
       Case #Explorerlistgadget
           String$ = GetGadgetText(#Explorerlistgadget)
   Endselect
It's not working!
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: Explorerlistgadget

Post by BarryG »

Code: Select all

If OpenWindow(0, 300, 200, 400, 200, "ExplorerListGadget", #PB_Window_SystemMenu)
  ExplorerListGadget(0, 10, 10, 380, 180, "c:\")
  Repeat
    ev=WaitWindowEvent()
    If ev=#PB_Event_Gadget And EventType()=#PB_EventType_Change
      i=GetGadgetState(0)
      Debug GetGadgetItemText(0,i)
    EndIf
  Until ev=#PB_Event_CloseWindow
EndIf
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 183
Joined: Thu Dec 28, 2023 9:04 pm

Re: Explorerlistgadget

Post by rndrei »

Thank you!
And how do you find out the full path of a file?
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: Explorerlistgadget

Post by BarryG »

Image

Code: Select all

If OpenWindow(0, 300, 200, 400, 200, "ExplorerListGadget", #PB_Window_SystemMenu)
  ExplorerListGadget(0, 10, 10, 380, 180, "c:\")
  Repeat
    ev=WaitWindowEvent()
    If ev=#PB_Event_Gadget And EventType()=#PB_EventType_Change
      i=GetGadgetState(0)
      Debug GetGadgetText(0)+GetGadgetItemText(0,i)
    EndIf
  Until ev=#PB_Event_CloseWindow
EndIf
Post Reply