GUI Components - GUI126
Since we are going through the BYW Method (Build Your Widgets) we then need to understand the components of a GUI
GUI Components
- Frames (basically an image)
- Window Library
- States
- Widget Description Objects
1. Frames (basically an image)
Frames is the technical term for an image used in GUI window. We can create our frame using 2d graphics library. You can search for one using Google but I picked gg to do this for me.
2. Window Library
The Window library presents ways of registering functions that would respond to mouse clicks, mouse drags, keyboard taps etc. It brings interactivity to your GUI.
There is not so much choices here. I used the glfw from opengl OpenGL is a cross platform GUI library. It supports both 2d and 3d graphics.
3. States
States are basically used global variables. They glue the window library events to the functions that updates your frames.
A common one is the map of rectangles to the Widget Description Objects. This enables you to know what part of your frame was clicked.
4. Widgets Description Objects
This are just structs (composite objects) describing your widgets. They should have their associated draw function and sub-variables describing your specific widget.