Re: [gtk-list] Clists -- double click or no



>  Is there a way to sense double click on the clists so that you can have
>  it pull up a dialog to edit the information (much like a listview in
>  some programs in Win95)?  If so, is this "koshier" in the X/GTK way of
>  doing things?

Yes and yes.  The "select_row" signal will pass on the event that
generated the signal to the handler, so you can use it to see whether
it was a double click.  Try something like this:

	void
	select_row_handler (GtkCList *clist, gint row, gint column,
			    GdkEvent *event, gpointer data)
	{
		if (event->type == GDK_2BUTTON_PRESS)
			printf ("Eeek!  Double click on (%d, %d)\n", row, column);
	}

	...

	gtk_signal_connect (GTK_OBJECT (my_clist), "select_row",
			    (GtkSignalFunc) select_row_handler,
			    NULL);

>  Also, is there a way to presize the "columns"  in the Clist (still
>  allowing them to be sizeable)?

You can use the gtk_clist_set_column_width() function for that.

  Quartic



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