Now taken the plunge and bought a MACBook Pro.
Looking at the explorer treegadge,t loaded the code from the help file and managed to get a blank gadget on screen.
Is there a default directory\folder for the MAC as on windows?
Asking as I wish to get my image file selector working on the MAC as well as windows.
Any help with code appreciated.
Regards
CD
Explorertreegadget
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Explorertreegadget
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Explorertreegadget
No, you have to supply at least "/" for the Directory$ parameter. The Windows example from help doesn't work and should be replaced by a working one in MacOS help.collectordave wrote:Looking at the explorer treegadge,t loaded the code from the help file and managed to get a blank gadget on screen.
Is there a default directory\folder for the MAC as on windows?
Unfortunately that's currently not possible. A pattern with file extensions doesn't work on MacOS. This should be documented in the MacOS help for ExplorerTreeGadget() and ExplorerListGadget() like it is documented for the OpenFileRequester():collectordave wrote:Asking as I wish to get my image file selector working on the MAC as well as windows.
An alternative to the ExplorerTreeGadget for MacOS would be to use an NSOpenPanel. Wilbert already demonstrated in this example code how to let the user choose files with predefined file extensions although ALL files will be visible. But the files with the predefined extensions are the only ones the user will be able to select...[color=#0040FF]MacOS help for OpenFileRequester[/color] wrote:Several extensions can be specified for a single type by using the ; (semi-colon) separator (not supported on OSX, the requester always displays all files).
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Explorertreegadget
Thanks Shardik
The start folder I have managed a get around by using an application global constant dependant on OS which with #PBnofiles gets me what I want.
Code on forum updated http://www.purebasic.fr/english/viewtop ... +module%3A
Regards
CD
The start folder I have managed a get around by using an application global constant dependant on OS which with #PBnofiles gets me what I want.
Code on forum updated http://www.purebasic.fr/english/viewtop ... +module%3A
Regards
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Explorertreegadget
You don't need to use CompilerIfs to display the root folder for Linux, MacOS and Windows. The slash ("/" ) works cross-plattform on all 3 platforms. I thus modified the code example from help to work cross-platform (without the file extension patterns which don't work on MacOS):
Alternatively you may use GetHomeDirectory() or GetTemporaryDirectory() which of course also work cross-platform... 
Code: Select all
If OpenWindow(0, 0, 0, 300, 300, "ExplorerTreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ExplorerTreeGadget(0, 10, 10, 280, 280, "/")
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
