NEW CODE: multiple file selection
- From: Nils Philippsen <nils rhlx01 rz fht-esslingen de>
- To: gtk-list redhat com
- cc: gtk-app-devel-list redhat com
- Subject: NEW CODE: multiple file selection
- Date: Tue, 21 Jul 1998 17:46:29 +0200 (CEST)
[ Cc:'ed to gtk-app-devel-list in case someone can use it, but beware - this
is rather untested and likely to change (hopefully, read below why) ]
Hello,
As some people might recall, I needed a possibility to select multiple files
at a time, read: a modified GtkFileSelection to shift-click, ctrl-click etc.
*drum roll* Half the job is done! (functionality, not integration, of course,
but read further on)
I have made a new widget (GtkMFileSelection, read: multiple file selection),
which does just this:
- Looks like normal file selection
- Use control key to extend the current selection (without ctrl, the selection
will be discarded)
- Use shift key to apply the last (un)selection to all files between the last
(un)selected file and the file you clicked on
- Double clicking on a file now won't act like you clicked on "OK" (is this
behaviour "expected", or should I have left this untouched?)
- The selected files can be retrieved with
GList *gtk_mfile_selection_get_file_names(GtkMFileSelection *mfilesel);
which is just a GList of gchar *. The list must be cleaned manually after
use.
What needs to be done:
- Click'n'Drag behaviour should be implemented
- Not only because I had to rewrite/copy a lot of internal handling code of
GtkCList/GtkFileSelection, this stuff _really_ belongs in GtkCList and
GtkFileSelection: The shift-click, ctrl-click stuff in GtkCList, the option
to select multiple files belongs into GtkFileSelection to avoid bloat and
compatibility issues (i.e. if the implementation of those 2 widgets change).
I didn't attach the code to the mail, brave ones may get this from
ftp://rhlx01.rz.fht-esslingen.de/pub/gtk/gtkmfilesel-0.1.tar.gz
instead. The archive includes the code (which has stubs for persistent file
system browsing - I planned to implement having the selection "surviving" a
directory change, but now I don't know if this is needed, so I might be
kicking this in the future), a test program and a Makefile, everything wrapped
in a separate directory for your convenience.
Comments on this would be very appreciated (especially on the issues of
coding, integration in the existing widgets and click'n'drag - still got none
to fewm clue how to implement this) - I tend to think I missed producing
optimal code at some points.
BTW: The copyright statement I added to the files is not for merits, it's
rather for the people to know whom to blame :-)
Bye, Nils
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nils Philippsen @college: nils@rhlx01.rz.fht-esslingen.de
Vogelsangstrasse 115 @home: nils@wombat.dialup.fht-esslingen.de
D 70197 Stuttgart - clickety click - phone: +49-711-6599405
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wer heute an der Bildung spart, Those who scrimp on education today,
hat morgen noch bloedere Politiker. get even dumber politicians tomorrow.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]