Gnutella Forums

Gnutella Forums (https://www.gnutellaforums.com/)
-   Gtk-Gnutella (Linux/Unix/Mac OSX/Windows) (https://www.gnutellaforums.com/gtk-gnutella-linux-unix-mac-osx-windows/)
-   -   Question regarding Right click menu in GTK CTree (https://www.gnutellaforums.com/gtk-gnutella-linux-unix-mac-osx-windows/52426-question-regarding-right-click-menu-gtk-ctree.html)

nmadhudia January 30th, 2006 10:59 PM

Question regarding Right click menu in GTK CTree
 
Dear friends,

I am using a GTK to develop one GUI. I have taken a event box in which there is a scrolled window. Inside the scrolled window there is a CTree. The number of tree nodes are going to be changed dynamically at run time according one XML document.

I want to know how can i connect a signal to a node such that each node will show me its corresponding right click menu. I have hard coded the nodes at present in the tree and i have made a rightclick menu. But i have no idea how to attach the menu to individual node so that each category of node can show their corresponding right click menus.

:confused:

nmadhudia January 30th, 2006 11:00 PM

test mail
 
Regarding Right click menu

Hyper-kun January 31st, 2006 12:43 AM

You shouldn't be using GTK+ 1.2 anymore. It's old and deprecated. Some distros even consider removing it completely. For newly-written software use GTK+ 2.0 instead.
GTK+ 1.2 really has no concept of a cursor in a CTree so you have to keep track of the last selected row manually and use that when you receive the "clicked" signal. With GTK+ 2.0 you can simply check the current cursor position in a GtkTreeView and also connected to the "cursor-changed" signal.

You can then fetch the node data and modify the current context popup menu or select the appropriate one from a set.
The nodes themselves don't receive any signal. You could manually delegate the signal to an object stored in the node of course, if you prefer it that way.

nmadhudia April 6th, 2007 01:21 AM

Thanks Hyper-kun
 
Quote:

Originally Posted by Hyper-kun
You shouldn't be using GTK+ 1.2 anymore. It's old and deprecated. Some distros even consider removing it completely. For newly-written software use GTK+ 2.0 instead.
GTK+ 1.2 really has no concept of a cursor in a CTree so you have to keep track of the last selected row manually and use that when you receive the "clicked" signal. With GTK+ 2.0 you can simply check the current cursor position in a GtkTreeView and also connected to the "cursor-changed" signal.

You can then fetch the node data and modify the current context popup menu or select the appropriate one from a set.
The nodes themselves don't receive any signal. You could manually delegate the signal to an object stored in the node of course, if you prefer it that way.


Thanks a lot buddy. This will really work buddy.


All times are GMT -7. The time now is 04:41 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.