PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Get iter from GtkListStore? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 1
TOPIC: Re:Get iter from GtkListStore?
#873
elopez93 (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Get iter from GtkListStore? 1 Month, 3 Weeks ago Karma: 0  
Hi!

I am developing a download manager, and I implemented a "floating menu". All right there. Now, if the user right clicks on some part of the UI (it's a treeview), the menu appears. I need to know the iter of the row in where the user right-clicked to make the menu appear, so as to get some data for the menu. I am using a GtkListStore as the Treeview's model. How can I get the iter?

Thanks!

Emilio
 
 
Last Edit: 2008/09/27 06:47 By elopez93.
  The administrator has disabled public write access.
#876
kksou (Admin)
Admin
Posts: 391
graph
User Online Now Click here to see the profile of this user
Re:Get iter from GtkListStore? 1 Month, 3 Weeks ago Karma: 8  
Please refer to:

Sample Code 69: How to display context sensitive popup menu with right mouse click in GtkTreeView?

The key is to use the signal "button-press-event" to know when there's a right mouse click, and then find out the row and column from x,y position of the mouse with GtkTreeview::get_path_at_pos().

Regards,
/kksou
 
  The administrator has disabled public write access.
#880
elopez93 (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Re:Get iter from GtkListStore? 1 Month, 3 Weeks ago Karma: 0  
Thanks!

Just to note, I also had to use GtkListStore::get_iter to get the iter using the position GtkTreeview::get_path_at_pos() had given me as a GtkTreePath.
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2008. kksou.com. All Rights Reserved