onto an app it will be started:
Code: Select all
OpenWindow(0, 270, 100, 270, 170, "Double click on app to start it")
ListViewGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20)
If ExamineDirectory(0, "/Applications", "")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory
If LCase(Right(DirectoryEntryName(0), 4)) = ".app"
AddGadgetItem(0, -1, DirectoryEntryName(0))
EndIf
EndIf
Wend
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
If EventType() = #PB_EventType_LeftDoubleClick
RunProgram("Open", "/Applications/" + GetGadgetText(0), "", #PB_Program_Open)
EndIf
EndIf
EndSelect
ForEvermind double clicking onto the virtual app folder to start the app):
Code: Select all
OpenWindow(0, 270, 100, 270, 270, "Double click on app to start it")
ExplorerTreeGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20, "/Applications/")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
If EventType() = #PB_EventType_LeftDoubleClick
RunProgram("Open", GetGadgetText(0), "", #PB_Program_Open)
EndIf
EndIf
EndSelect
ForEver
