Kiosk GUI Screens

I just tested Nuklear in a VM to see how it does. Not all of the demos compile as written, and if you're new to C, there will definitely be a lot to learn.

Code:
$ cd
$ mkdir -p work && cd work
$ git clone https://github.com/Immediate-Mode-UI/Nuklear.git
$ cd Nuklear/demo/x11
$ export CPATH=/usr/local/include && export LIBRARY_PATH=/usr/local/lib && make
$ ./bin/zahnrad

Screenshot at 2022-05-20 01-10-47.png
 
Well it took Jose offline pushing to get me going. I now have the visual part down now how do I assign command line actions to buttons?
Need to adjust font size.

Modified from centered example code.
Code:
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Flow.H>
#include <FL/Fl_Box.H>

int main()
{
  Fl_Double_Window win(480, 800);
  Fl_Flow flow(0, 0, win.w(), win.h());
  Fl_Button button1(0, 0, 400, 125, "Mapping");
  Fl_Button button2(0, 0, 400, 125, "Music");
  Fl_Button button3(0, 0, 400, 125, "Browser");
  Fl_Button button4(0, 0, 400, 125, "Video");
  Fl_Button button5(0, 0, 400, 150, "Shutdown");
  Fl_Box side(0, 0, 30, 1);
  side.color(FL_CYAN);
  side.box(FL_FLAT_BOX);

  flow.rule(side, "<=^");

  flow.rule(button1, "=<^");
  flow.rule(button2, "=<^");
  flow.rule(button3, "=<^");
  flow.rule(button4, "=<^");
  flow.rule(button5, "=<v");
  win.resizable(flow);
  win.show();

  return Fl::run();
}
fl_flow.jpg
 
In the same vein is there an FLTK runtime lib for the executable available so I don't have to install the whole toolkit on another box?
Is that possible?
Thinking smallest possible implementation. I know the toolkit is only 7MB it's just the thought.

What about FLTK 2.x. Its now offered but will it be backwards code compatible?
 
In the same vein is there an FLTK runtime lib for the executable available so I don't have to install the whole toolkit on another box?
Is that possible?
You should be able to link against the static FLTK library rather than dynamic.

Check out the -static (or -l:libfltk.a) flags when invoking the compiler.
 
I now have the visual part down now how do I assign command line actions to buttons?
You have to add a callback to your button.
Need to adjust font size.
Decent example of font handling here: https://github.com/fltk/fltk/blob/branch-1.3/examples/textdisplay-with-colors.cxx

What about FLTK 2.x. Its now offered but will it be backwards code compatible?
Yeah, that a little weird. Turns out 2.x is an ancient dead branch. New development will become 1.5. I don't know for sure about backwards compatibility, but lurking on their mailing list makes me think they'll do that. They're super helpful and user-focused.
 
Back
Top