[gtkmm] Manually selecting rows in Gtk::TreeView
- From: "Simon Fuhrmann" <NightSlayer gmx de>
- To: <gtkmm-list gnome org>
- Subject: [gtkmm] Manually selecting rows in Gtk::TreeView
- Date: Sun, 18 Apr 2004 13:22:09 +0200
Hi hackers!
I have a problem that deals with popup menus on Gtk::TreeView's.
I have registerd a signal handler for 'signal_button_press_event()'
of a TreeView like this:
this->filelist.signal_button_press_event().connect
(SigC::slot(*this, &cGuiMain::button_pressed), false);
I use 'false' as second argument to 'connect()' because if I omit
it (or set it to 'true') the TreeView will handle the right mouse
click first and my signal handler will not be called.
The 'cGuiMain::button_pressed()' signal handler will only return
'true' if it handles the right mouse button, otherwise it returns
'false', this allows the TreeView to handle all other mouse clicks.
My TreeView uses multiple selections. So if someone presses the right
mouse button and multiple rows are selected, I just want to display
my popup menu immediately, which works. But if the selection consists
of only one or none rows, I want to select the row the mouse is
over before I popup my context menu. If I don't do that, the context
menu will be created for the selected row, which must not be the one
the mouse is over, and this is strange behavior in my opinion.
How can I select the row the mouse is over from my
'cGuiMain::button_pressed()' signal handler?
Thanks for help,
Simon Fuhrmann <Nightslayer at gmx.de>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]