RequestFile quirks

Archives Forums/Linux Discussion/RequestFile quirks

plash(Posted 2008) [#1]
Consider this example:
RequestFile("file load", "", False, CurrentDir() + "\")

It will ask the user for a file using a graphical interface.
However, adding framework and imports it will ask for a file from maxide (seems to be using standardio - Input())
Framework brl.system
Import brl.standardio

RequestFile("file load", "", False, CurrentDir() + "\")


I knocked up this example because I can't post my program's code. If anyone knows a workaround, please post.


plash(Posted 2008) [#2]
Nevermind, finally figured it out. You have to import brl.fltkmaxgui or bah.gtkmaxgui.

NOTE: FLTK users, in my app (which uses wxmax and most of the brl modules, along with bah.crypto) after the user has selected a file and hit OK, or enter, the main program will get the filename etc, but the file request window will not be destroyed.


SebHoll(Posted 2008) [#3]
Yeah, this is because Linux doesn't have standard GUI elements integrated in the OS - the default BlitzMax Linux System gets around this by using the Input() command (it's better than nothing, but hardly ideal). Whenever a Linux GUI library is linked, the default BlitzMax Linux driver gets replaced and any visual interactions are then handles by the GUI library's driver. It is for that reason why loading either of the Linux MaxGUI modules fixes the problem.


Brucey(Posted 2008) [#4]
in my app (which uses wxmax

Possibly not a good idea to mix things like RequestFile with wxMax.
For example, on OS X, if you use Notify with wxMax, your app will surely crash.

You may find using the wxMax-native file requesters much more configurable too. For example, the file requester takes x/y params too, which is handy if you want to center it. (Actually, I had thought about answering your other thread about centering file requesters but wasn't sure if you were using wxMax or not).
There is a wxFileDialog type, and a wxFileSelector helper function.


Just a thought :-)


plash(Posted 2008) [#5]
Wonderful! I hadn't known about the wx file requesters :)
Thanks again Brucey.


Devlin(Posted 2008) [#6]
Is there any way to fix this with just a vanilla v1.28 install of BlitzMax?

I'd rather not add any modules, etc if at all possible.