[gtkada] Creating a file selector for multiple files

Emmanuel Briot briot at ACT-Europe.FR
Mon Feb 11 15:29:31 CET 2002


manuel.op.de.coul at eon-benelux.com writes:

> You'd have to write it yourself probably. I find the 
> current Gtk.File_Selection to be inadequate for a real
> application. And I'm anxious to know if Gtk 2.0 will
> provide a better one. If it doesn't, I'm probably 
> going to make a better one myself.

No, there isn't a new one in gtk+2.0. I think it is planned for gtk+2.2, but
this is still a long way in the future, I think.
We have coded such a file selector for some future version of gvd, the GNU
visual debugger, but this is also not available yet.
Basically, as Manuel recommended, the best way is to write it yourself, which
in fact is not very difficult, if you use all the subprograms that GNAT
provides in GNAT.Directory_Operations. This is even portable (well, apart from
supporting windows drives).

> There's also a problem with it under Windows, if you
> use it on a directory which contains 2000 files or so,
> it takes a loooong time to appear, maybe more than
> 20 seconds, much longer than a Windows file selector
> takes.

The trick we have been using is to fill the tree in an idle loop (see
Gtk.Main). It still takes some time if you have lots of files, but at least the
rest of the interface is not frozen.
This is much harder to code however.

Emmanuel




More information about the gtkada mailing list