[Insight-users] Menu by right-mouse-click using FLTK?
Luis Ibanez
luis.ibanez at kitware.com
Mon Jul 26 10:16:30 EDT 2004
Hi Zein,
Using FLTK you can display a menu with the right button
by managing that event on the "handle()" method.
You probably want to create a Fl_Menu_Button object
at that point.
http://www.fltk.org/documentation.php/doc-1.1/Fl_Menu_Button.html#Fl_Menu_Button
Something like
handle( int event )
{
if( event == FL_RIGHT_MOUSE )
{
Fl_Menu_Button * popup = new Fl_Menu_Button(0,0,400,400);
popup->type(Fl_Menu_Button::POPUP3);
popup->add("This|is|a popup|menu");
}
}
(making popup a member variable of the
viewer would be a better option...)
You will find examples of popup menus in the
FLTK /test directory. In particular
checkers.cxx
menubar.cxx
subwindow.cxx
Regards,
Luis
----------------
salah wrote:
> Hello,
>
> I posted this question long age and did not get an answer. Please, if
> anybody
> can help of give ideas.
>
> Thanks,
> Zein
>
> ----------------------------------------------------------------------------------
>
> Hello All,
>
> I am trying to implement a menu (using fltk) that appears besides the
> mouse pointer when the right mouse
> buttom is pressed while the mouse pointer is inside the widget of a
> GLSliceViewer.
>
> Is there an ITK example/application that uses/implements such a menu?
>
> Thanks in advanced,
>
> Zein
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list