RE: [gtkmm] TreeView && Popup Menu



Murray Cumming
murrayc usa net
www.murrayc.com 

> -----Original Message-----
> From: Andrew E. Makeev [mailto:andrew solvo ru] 
> Sent: Mittwoch, 25. Juni 2003 17:06
> To: Marcel Karras
> Cc: gtkmm-list gnome org
> Subject: Re: [gtkmm] TreeView && Popup Menu
> 
> 
> Marcel Karras wrote:
> 
> >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.
> >
> >  
> >
> Everything should be clear if you'd read tutorial carefully:
> ...
> <widget>.signal_button_press_event ().connect (<slot>, false); // not 
> release! cuz press gonna toggle checkbox
> ...
> 
> bool <slot>  (event)
> {
>     if (event->button == 3)

I think there's an enum for this.

>     {
>         <popup>
>         return true; // stop signal
>     }
>     return false; // continue signal processing

I prefer
"// stop any further handling of this signal"
and
"// allow further handling of this signal".

because those are the terms we use in the documentation now.

> }
> 
> If this question wasn't mentioned in FAQ yet, guess, it is 
> time for it.

Yes, I agree. Patch?

Murray Cumming
murrayc usa net
www.murrayc.com



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