[Gtk-sharp-list] Treeviews and popups, and easy way?

Christian Hoff Christian_Hoff at gmx.net
Mon Jun 16 07:08:14 EDT 2008


Hi,

I had exactly the same problem(after a click with the right mouse button only the item that was clicked on remains selected). There are basically two ways two work around this problem: 

One would be to use the ConnectBefore attribute(overriding OnButtonPress won't work because it sometimes gets called afterthe TreeView processed the event and updated the selection). (In my opinion using the attribute isn't "hackish" at all)

Another one would be to drop the idea of the context menu and instead making the column titles clickable. The disadvantage is that this functionality won't be easy to discover. 

Christian Hoff

-------- Original-Nachricht --------
> Datum: Fri, 13 Jun 2008 11:26:54 -0700 (PDT)
> Von: Anders Aagaard <aagaande at gmail.com>
> An: gtk-sharp-list at lists.ximian.com
> Betreff: [Gtk-sharp-list]  Treeviews and popups, and easy way?

> 
> Hi
> 
> I'm using monodevelop, and I have a treeview that needs to support
> multiple
> selections, and a popup menu.
> 
> I dont really want to make my own custom treeview and override
> OnButtonPress
> if I can avoid it, as I use monodevelop and it'd be a lot cleaner for me
> to
> keep the ui in the ui designer.
> 
> I've tried a few different solutions to work around this problem, mostly
> [ConnectBefore] on my OnTreeviewButtonPress, and then a function that's
> called immediatly to update the selected treeview based on
> ButtonPressEventArgs, but this seems awfully hackish, and isn't reliable
> (and since I switched to MultipleSelect, not really working at all).
> 
> Does anyone have any similar functions?  Preferably something that works,
> I
> just want to be able to get the currently selected rows from my
> OnTreeviewButtonPressEvent.
> 
> Is there any clean way of implementing a popup menu in a treeview when you
> need to know the selection?  I've googled for hours now, and everything I
> find is a ton of fairly hackish code.
> 
> Anders Aagaard
> -- 
> View this message in context:
> http://www.nabble.com/Treeviews-and-popups%2C-and-easy-way--tp17829552p17829552.html
> Sent from the Mono - Gtk# mailing list archive at Nabble.com.
> 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx


More information about the Gtk-sharp-list mailing list