Re: Keeping tree rows selected during a pop-up menu
- From: "Jonathon Jongsma" <jonathon quotidian org>
- To: "Matt Bragano" <maestro485 comcast net>
- Cc: gtkmm-list gnome org
- Subject: Re: Keeping tree rows selected during a pop-up menu
- Date: Thu, 8 Nov 2007 16:23:04 -0600
On 11/8/07, Matt Bragano <maestro485 comcast net> wrote:
> I have a TreeView that allows multiple selections. When multiple
> selections are made and the user right-clicks, a pop-up menu appears
> where the user can choose to add the selected files to a play list. My
> problem is that whenever the right mouse button is released and the menu
> appears the selections are unselected, which makes the option to add
> selected files useless from the pop-up menu (although it still works
> fine from the standard menu bar).
>
> So I'm wondering how I can maintain the selection after the TreeView
> itself loses focus to the pop-up menu. I messed around with
> TreeSelection::set_select_function() but I was unable to make the
> callback slot behave properly.
>
> Any suggestions?
>
> Thanks,
> Matt Bragano
You might look at the code I wrote for nemiver's Breakpoints list
where I do something similar. The code is at
http://svn.gnome.org/svn/nemiver/trunk/src/persp/dbgperspective/nmv-breakpoints-view.cc.
Most of the action is in on_breakpoints_view_button_press_signal().
The important things to note are that the signal is connected
*before* the default handler (pass a 3rd parameter of 'false' to
connect()), and that I return 'true' from the signal handler to
prevent the default handler from running (which would result in all of
the other rows becoming de-selected).
--
jonner
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]