Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Load a file with DIALOGs

Credits go to miran for helping out!
This thread is locked; no one can reply to it. rss feed Print
Load a file with DIALOGs
James Stanley
Member #7,275
May 2006
avatar

Is there an easy way to get a filename using a DIALOG? For example, is there an allegro DIALOG, so that I could type:
do_dialog(allegro_file_loader, -1);
Or even a proc I could put in a dialog to get a filename. Any advice would help. If not, I can always write my own, but why reinvent the wheel?

miran
Member #2,407
June 2002

You mean file_select_ex?

If so, why didn't you read the manual? ;)

--
sig used to be here

James Stanley
Member #7,275
May 2006
avatar

Ah, thanks.
You won't believe me but I did (briefly) check the manual but didn't find it.

ImLeftFooted
Member #3,935
October 2003
avatar

Allegro's file selector is ugly, should be redone.

Maybe allegro could use a wrapper to get the OS / WM's native file selector

Kitty Cat
Member #2,815
October 2002
avatar

That'd only work in windowed modes. In fullscreen modes you're not gauranteed to be drawing to the same screen area the OS would. And there's no gaurantee the OS's file selector would show on top of the app.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

ImLeftFooted
Member #3,935
October 2003
avatar

Still could be usefull. A lot of games come with editors that might only be in windowed mode.

Kitty Cat
Member #2,815
October 2002
avatar

It'd also really only be useful for Windows and KDE-based (maybe a few others) systems, too. Linux has no general concept of a file selector. There's none in Linux console mode. Some DMs don't have a built-in file selector. With KDE you can make a call to kdialog and read its stdout, but I don't believe Gnome/GTK has a similar external method. And of course, just the presense of kdialog doesn't mean you're on a KDE-based system, nor that it's the kdialog program you think it is. You can always try to run dcop to see if the dcop server is running (which would be a good indication that you're using KDE), but that won't be reliable for very long since dcop isn't being used in KDE 4.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

ImLeftFooted
Member #3,935
October 2003
avatar

You'd do it where possible, like all the other allegro drivers do.

Go to: