Re: Widget mask out clicks



On Thursday 04 January 2007 08:28, johnmb wrote:

> Paul Davis wrote:
> > On Wed, 2007-01-03 at 01:14 -0800, johnmb wrote:
> >> I am trying to make a widget insensitive to mouse clicks but active in
> >> all
> >> other respects using the following statement :-
> >>
> >>     m_TreeView->set_events(~Gdk::BUTTON_PRESS_MASK);
> >>
> >> This doesn't work, what am I misunderstanding about event masks ?
> >
> > m_TreeView->unset_events (Gdk::BUTTON_PRESS_MASK);
>
> Thanks for the reply Paul,
>
> I tried your suggestion but get the following error message when compiling
>
> gui_menu.cc:76: error: 'class Gtk::TreeView' has no member named
> 'unset_events'

Your original approach was right: set_events() will reset the event mask (as 
opposed to add_events() which will not), although a better approach may be to 
call m_TreeView->set_events(m_TreeView->get_events() & 
~Gdk::BUTTON_PRESS_MASK).

However, did you call set_events() before the widget was realised?  It won't 
work if you do not.

Chris




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]