Re: [gtkmm] TreeView && Popup Menu



On Wed, 25 Jun 2003 13:37:28 +0200
Murray Cumming Comneon com wrote:

> > From: Andrew E. Makeev [mailto:andrew solvo ru] 
> > Marcel Karras wrote:
> > 
> > >Thank you so far.
> > >The problem now is that I use Gtk::CellRendererToggle() in 
> > my treeview
> > >and I can't suppress the toggling by right-clicking to 
> > mouse. Any ideas?
> > >
> > >  
> > >
> > 1. try to connect your signal callback with after parameter 
> > set to false.
> 
> connect_notify() will do the same thing and is much clearer:
> e.g.:
> http://www.gtkmm.org/gtkmm2/docs/reference/html/classGlib_1_1SignalProxy2.ht
> ml

It doesn't make any differences to me:

---
treeview.signal_button_release_event().connect_notify(
  SigC::slot(*this, &RedFilesDialog::on_treeview_click));
---

The function:

---
void RedFilesDialog::on_treeview_click(GdkEventButton *_pButtonEvent)
{
  if( _pButtonEvent->type == GDK_BUTTON_RELEASE &&
      _pButtonEvent->button == 3 )
  {
    std::cout << "popup" << std::endl;
  }
}
---

"popup" appears correct on right-click but the toggle widget will toggle
anyways.

-- 
Contact: toka freebits de
http://www.freebits.de
Unix, Linux && OpenSource



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