Re: [gtkmm] TreeView && Popup Menu
- From: Per Jonsson <per jonsson home se>
- To: gtkmm-list gnome org
- Subject: Re: [gtkmm] TreeView && Popup Menu
- Date: Tue, 24 Jun 2003 23:55:34 +0200
On Tue, 24 Jun 2003 15:21:59 +0200 Marcel Karras <toka freebits de>
wrote:
> Hello,
>
> I want to popup a menu when right-clicking on a Gtk::TreeView but
> where to place the EventBox for it? Do I even need one?
>
Just connect the button_release_event signal to a method, like this:
m_YourTreeView.signal_button_release_event().connect(
SigC::slot(*this, &CYourClass::onTreeViewClick) );
bool CYourClass::onTreeViewClick(GdkEventButton *_pButtonEvent)
{
if( _pButtonEvent->type == GDK_BUTTON_RELEASE &&
_pButtonEvent->button == 3 )
{
m_PopupMenu.popup(_pButtonEvent->button, _pButtonEvent->time);
return true;
}
return false;
}
--
Per Jonsson
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]