Re: another multiple selection question



Dave Reed wrote:

On Wednesday 16 April 2003 17:41, Sven Neumann wrote:
Hi,

Dave Reed <dreed capital edu> writes:

How do you tell which rows are selected when in multiple selection
mode?

When I call get_selected, I get:

Gtk-CRITICAL **: file gtktreeselection.c: line 360 (gtk_tree_selection_get_selected): assertion `selection->type != GTK_SELECTION_MULTIPLE' failed
Segmentation fault (core dumped)
you better report that as a bug. It might be wrong to use that
function when GTK_SELECTION_MULTIPLE is active, but it should not run
into an assertion.

It does appear from the documentation that you can't use get_selected
when the mode GTK_SELECTION_MULTIPLE is so I don't know whether it
should be a bug or not.

Another person suggested gtk_tree_selection_get_selected_rows. That
must be fairly recent. It's not in the gtk2 that comes with RHL 8.0,
but is in the one for RHL 9, but the pygtk bindings that come with RHL
9 don't include it. Looks like the gtk web documentation hasn't caught
up since it's not on there yet either.

For now, I found that gtk.TreeSelection.selected_foreach does work.

I'd still like to make it so that holding the control key is not
required for multiple selection. Does anyone know if that is possible
and if so, how to do it?

You might be able to do it by using your own callback for the widget's button click event. If you return "TRUE" from your callback function you tell GTK+ that you've completely handled the event and not to continue with GTK+'s default actions. You would have to re-create all of the logic of selecting and unselecting rows in your own routine, but you would have complete control of the functionality.


Thanks,
Dave

_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



--
Seth Remington
SaberLogic, LLC
661-B Weber Drive
Wadsworth, Ohio 44281
Phone: (330)335-6442
Fax: (330)336-8559





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]