You do probably want labels, instead.
If you only have one ore two labels you could probably simplify this a lot and just list them each seperately. The functions you'd want to call are createLabel() to create the label, resizeWindow() to set the size of the label, moveWindow() to set the position of the label, setFgColor() and setBackgroundColor() to set the colors, and echo(labelname,"some text") if you want to print text in the label. Labels also let you set a picture with setBackgroundImage()
However, I like a bit more modular setup so that I can move things around when I add a new label and when I resize the winow. This is how my gui is setup. I have labels with images (compass and cond), and labels with just a color background that can change (zlighting):
Then I have the actual function that's called when the window is resized to move the gui around, it re-renders each gui item:
And finally an example of code to update the icon label compass and lighting (text with color) labels:
setGui(gui.compass,gui.compass.northEast,"on") --sets the image to "on.png"
setTextGui(gui.zlighting,gui.zlighting,"Lght: 100","0 255 255","100 100 100") --makes the lighting label read "Lght: 100" with yellow text and a grey background.
The final result is a compass and some on/off toggle icons and a label that changes color with the lighting level, all of which is anchored to the right of the window when the window resizes.