Hardware Reference
In-Depth Information
Thus, the
Setup_gui
method is the main method used to set up the interface,
as shown here:
This is where you define which controls will be inserted and their arrangement,
and more precisely their layout:
1.
Label
: As we want to define our GUI on three different parts of the screen,
the program relies on a grid
layout
. The method also
defines a text zone
dedicated to the communications with the board, debugging details,
and so on.
2.
Spinner
: This is a color selector when clicked on so that you can choose a color.
3.
A matrix made up of 64 buttons
: Instead of defining all of them individually,
a
for
loop is in charge of instantiating all the buttons. We then associate (
bind
)
each new button click event to a dedicated handler (
callback
). Let's take a look
at this callback method; it is shown in the following screenshot: