Load a file with DIALOGs
James Stanley

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

You mean file_select_ex?

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

James Stanley

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

Dustin Dettmer

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

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.

Dustin Dettmer

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

Kitty Cat

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.

Dustin Dettmer

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

Thread #585766. Printed from Allegro.cc