Search code examples
user-interfacearduinoembeddedstm32esp32

How are good UI libraries structured and what components are needed?


Hello fellow developers,

So I'm working on a small project of mine with an STM32 where I need a display and I wanted to write the UI library from scratch to learn more stuff.

My question is: How would you go on to write such UI library?

The driver for the display is already ready.

What I need:

  • A good and extensible menu system which is easy to use
  • Button events
  • Containers/Windows

I did a bit of research and from what I know now it is good to start with some kind of Window/Container component and then move to all the other types of widgets I need.

What do you think? How would you structure this kind of library/project? And how would you start?

I'm greatful for any help. Kind regards ^^


Solution

  • You may have already looked at this during your research.

    Here are links for some popular UI's for java - both AWT and Swing :

    AWT
    Swing

    They give you a good example of the structure.

    here is a developer's guide for LWUIT :

    LWUIT

    LWUIT is a scaled down UI for Java ME (micro edition), so it gives you an idea of what is needed for a minimal UI.

    My approach would be to start small, get it working and build up from there. This sounds obvious, but I am always amazed at how often it is not followed.

    If you install and run java on your computer, you can see exactly how AWT or Swing works and look at the source code to get a better understanding.