Re: [gtkmm] TreeView && Popup Menu
- From: "Andrew E. Makeev" <andrew solvo ru>
- To: Marcel Karras <toka freebits de>
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] TreeView && Popup Menu
- Date: Wed, 25 Jun 2003 19:05:59 +0400
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)
{
<popup>
return true; // stop signal
}
return false; // continue signal processing
}
If this question wasn't mentioned in FAQ yet, guess, it is time for it.
Regards,
-andrew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]