Re: clist EXTENDED selection & keyboard
- From: Taura Milana <learfox furry ao net>
- To: GTK App Devel <gtk-app-devel-list gnome org>
- Subject: Re: clist EXTENDED selection & keyboard
- Date: Sun, 24 Feb 2002 14:42:51 -0800
On 2002.02.24 03:41 toDSaH wrote:
This works, but only for 1 selected file. If I create a selection of
multiple files with the keyboard (using shift + arrow) and I call the
panel_showselected() function, cur oddly enough is NULL. After the call
to panel_showselected() the arrow keys also stop working. When I use the
mouse to click somewhere in the list (for the first time), the arrow
keys work again, and after this, selections made with shift+arrows DO
work (as in, cur is a pointer to the GList of selected files) and keep
working.
Could somebody explain to me what I'm doing wrong or what I forgot? It
would seem this is a focus problem, but if that's the case, how come I
can use the arrow keys to move around the list?
You should watch for the "select_row" signal, each time that
occures you should check the selection. Iterate the selection
with the following code:
/* Iterate through all selected rows. */
int row;
GList *glist = clist->selection;
while(glist)
{
row = (gint)glist->data; /* Get selected row index. */
/* Do something with the row here. */
glist = glist->next;
}
/* Get just the last selected row. */
int row;
GList *glist = clist->selection_end;
row = (gint)glist->data; /* Get last selected row index. */
/* Do something with the row here. */
Keep in mind that this works only for the GtkCList, if you
are using the GtkCTree casted to a GtkCList then things
work differently (let us know if you plan to use the GtkCTree).
Btw, there's a file manager with extended key handling for
the GtkCList. See http://wolfpack.twu.net/Endeavour2
--
Sincerely, ,"-_ \|/
-Capt. Taura M. , O=__ --X--
..__ ,_JNMNNEO=_ /|\
OMNOUMmnne. {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn. 'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe. "7OMMMMNNNNNWWEEEEOOOOOO" "'.
EEBNNMMMNWNWWEEIMMNe. __ 7EMMMNNNNNWWWEEEEEEEOO. " .
NNMMMMWWWMMMWEINMMMNn "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._ .
http://furry.ao.net/~learfox/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]