Dialog.OpenFile()

Post your Gambas programming questions here.
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Dialog.OpenFile()

Post by stevedee »

cage wrote: Monday 4th January 2021 12:48am While the Dialog Openfile works quite well, I have not found that the Dialog Path can be set even though the documentation says it can...
It looks like I can set the Dialog.Path property, but it doesn't behave the way I would expect it to.

If I set it like this:-
Dialog.Path = User.Home
...or like this:-
Dialog.Path = "/home/steve"
...the dialog opens in the /home directory but expands the /home/steve directory like this:-
DialogPath.png
DialogPath.png (44.84 KiB) Viewed 2045 times
But if I do this:-
Dialog.Path = "/home/steve/
...it opens correctly in the /home/steve directory (i.e. shows the files for /home/steve in right-hand pane).


In the Help for Dialog.Open() it shows an example with: Dialog.Path = User.Home
DialogPath2.png
DialogPath2.png (111.88 KiB) Viewed 2045 times
It says that the dialog will show the users home directory (which is does) so I'm not sure if this is a bug or 'by design'.
cage
Posts: 123
Joined: Monday 2nd September 2019 5:47am
Location: Phoenix Arizona

Re: Dialog.OpenFile()

Post by cage »

Thanks stevedee I got it working. I found a thread by Charlie that explained what I was doing wrong. Seems you need us gb.gui.qt in order for the dialog to work correctly. It does not work if you use gb.gui, qt5 or gtk. I incorporated into a test version of my program and got it working. It's now part of my main program. As always I wish to thank you very much for the help.
Post Reply