Custom widgets in FLUID

77 views
Skip to first unread message

anmol....@gmail.com

unread,
May 5, 2021, 3:59:14 PM5/5/21
to fltk.general
From the documentation,

>>>

The constructor should have the following arguments:

MyClass(int x, int y, int w, int h, const char *label = 0);

This will allow the class to be used in FLUID without problems.

>>>

I have a Double_Window() -> Tabs () -> Group () inside FLUID. When I try to add anything from New -> Code it automatically adds it outside the window.

The only widgets that can be added via FLUID are the pre-defined widgets inside the New -> (NOT Code)

Inside the FLUID example, we use the CubeView class but again, all the widgets added are the pre-defined widgets in FLUID.

Am I missing something that will allow me to add custom widgets ?

anmol....@gmail.com

unread,
May 5, 2021, 4:13:37 PM5/5/21
to fltk.general

>>>
  • Similar to other widgets, click FLUID menu

    New/Other/Box
  • to add a custom widget to the window. It appears in the design view as a square box.

  • In the properties window for our custom widget,

    • Enter the name of the class, e.g. Drawing2D in the Class: field.

    • In the Extra Code: field enter #include "path/Drawing2D.h" to make sure that the class header is included.

>>>
The widget will only appear after you compile and run it. It will not show in the preview window from within FLUID.

Thank you for this feature.
Reply all
Reply to author
Forward
0 new messages