I have a Gtk::TreeView popuplated with rows. When the user right-clicks on
one of the rows, a menu pops up and the user has several choices. I can
attach a callback function to one of these menu choices and it's being
called correctly, but how can I pass to the callback function some type of a
reference to what row was right-clicked?
I hope that makes sense,
Joe
Hi,
I have a Gtk::TreeView popuplated with rows. When
the user right-clicks on
one of the rows, a menu pops up and the user has
several choices. I can
attach a callback function to one of these menu
choices and it's being
called correctly, but how can I pass to the callback
function some type of a
reference to what row was right-clicked?
I hope that makes sense,
Joe
When the user right-clicks on a row, it gets selected
and the selected row can be retrieved with:
treeview.signal_connect('button-press-event'){|tv, eb|
if eb.button == 3
path, column = treeview.cursor
p path.to_s
end
}
Is that enough?
You could join us on the Ruby-GNOME2 mailing list at
Cheers,
Joao
···
--- Joe Laughlin <Joseph.V.Laughlin@boeing.com> wrote:
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
Joe Laughlin wrote:
I have a Gtk::TreeView popuplated with rows. When the
user right-clicks on one of the rows, a menu pops up and
the user has several choices. I can attach a callback
function to one of these menu choices and it's being
called correctly, but how can I pass to the callback
function some type of a reference to what row was
right-clicked?
I hope that makes sense,
Joe
Another GTK question: Isn't there some type of a GTK timer event that I can
have call a given function or do a certain action every X milliseconds? I
looked through the API docs, but I couldn't see it, but I remember using
something like that with pygtk.
Hi,
Joe Laughlin wrote:
Another GTK question: Isn't there some type of a
GTK timer event that I can
have call a given function or do a certain action
every X milliseconds? I
looked through the API docs, but I couldn't see it,
but I remember using
something like that with pygtk.
Like this? 
Gtk.timeout_add(5000){
p Time.new
# returns false to end the timer
false
}
Cheers,
Joao
···
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail