FLTK logo

Re: [fltk.general] Right clicking on a check button label

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Right clicking on a check button label supsm17 May 03, 2022  
 
this should work as an example

// generated by Fast Light User Interface Designer (fluid) version 1.0306

#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Menu_Button.H>

Fl_Menu_Item menu_menu[] = {
 {"item", 0,  0, 0, 0, (uchar)FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0}
};

int main(int argc, char **argv) {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(120, 100);
    w = o; if (w) {/* empty */}
    { Fl_Menu_Button* o = new Fl_Menu_Button(25, 25, 69, 20, "menu");
      o->type(2);
      o->menu(menu_menu);
    } // Fl_Menu_Button* o
    o->end();
  } // Fl_Double_Window* o
  w->show(argc, argv);
  return Fl::run();
}


On Tuesday, May 3, 2022 at 2:53:07 PM UTC-7 Ian MacArthur wrote:
On 3 May 2022, at 20:16, supsm17 wrote:
>
> That should probably work, but for some reason the label (or box) doesn't show up when the type is changed. It still appears, but is just invisible. Am I missing something?


It certainly should work.
I have no idea why it would not - you will have to show us an example of what you are doing.
Can you post a minimal, compileable, example that shows the effect, so we can see what has gone awry, please?


>
> On Monday, May 2, 2022 at 2:34:18 PM UTC-7 Ian MacArthur wrote:
> On 2 May 2022, at 19:17, supsm17 wrote:
> >
> > I have a Fl_Check_Button which has a label, I want some menu to pop up when I right click the label. I'm not sure if this could be accomplished with Fl_Menu, but for the right click I think I can use a boxless Fl_Button. Will I have to have a hidden Fl_Box?
>
>
> Would you not just use an Fl_Menu_Button, with the box type and text set appropriately, as the label?
>
> Just set the type to POPUP3 (well, I think it is POPUP3 for the right click... might be POPUP2...) and that’s basically the job done.
>
> https://www.fltk.org/doc-1.4/classFl__Menu__Button.html#a2c0d1cab5522c531309169acf0e1517e
>

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/c6a1781c-64ec-4299-bd62-753b741f6c65n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.