[Gtk-sharp-list] TreeView context menu.

George Farris farrisg@mala.bc.ca
19 Feb 2003 09:42:09 -0800


Well actually I've gotten a bit further since I emailed the list I have
a function that looks like so:

private void book_selection_changed(object o, EventArgs args)
{
	Gtk.TreeIter iter =3D new Gtk.TreeIter();
       	Gtk.TreeModel model =3D (o as TreeView).Model;
       	Value value =3D new Value ();
	string  sel;
		=09
	if (book.Selection.GetSelected(out model, ref iter))
	{
		model.GetValue(iter, 1, value);
	}
}

I'm just not clear on the whole "value" thing yet.  Any ideas?



On Wed, 2003-02-19 at 05:31, Pablo Baena wrote:
> Make the TreeView widget catch the button_press_event signal. The
> handler method would look like this:
>=20
>=20
> private void OnTreeViewButtonPressEvent (object o, ButtonPressEventArgs a=
rgs)
> {
> 	Gdk.EventButton eventbutton =3D args.Event;
>                                                                          =
 =20
> 	if (eventbutton.button =3D=3D 3)
> 		// make the popup display
> }
> I guess this is all you need, I didn't even work with TreeView.
>=20
> Pablo
>=20
>=20
> On Wed, 2003-02-19 at 07:36, =D8yvind Hvamstad wrote:=20
> > Hi, all. Great effort on the port!
> >=20
> > I am not that into gtk, even so I would like to attach a glade generate=
d
> > popupmenu to a TreeView, I have the glade bit, and the TreeView bit all
> > sorted out, but how do I catch a right mouse click so I can fire up the
> > menu?
> >=20
> > Hope someone can help.
> >=20
> > =D8yvind (ISO-8859-1)
> >=20
> > _______________________________________________
> > Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>=20
>=20
> --=20
>=20
> Pablo Baena <pbaena@uol.com.ar>
--=20