Bambookit Home    Bambookit GUI Tutorial

Back    Next   

II. GUI Basics

Chapter 9. Widgets Styles


Method signature

setInsets = "[int] left, [int] top, [int] right, [int] bottom"
default settings, setInsets="2,2,2,2"


In this example we will be using a button widget

.. setInsets="4,0,0,0" setAlign="left" ..
it reads as;
Indent the left side by 4 pixels
The top, right and bottom are not indented

but what about right aligned text?
.. setInsets="0,0,4,0" setAlign="right" ..
The left, top are not indented
Indent the right by 4 pixels
The bottom is not indented.

and top aligned text?
.. setInsets="0,4,0,0" setAlign="top" ..
The left is not indented
Indent the top by 4 pixels
The right, bottom are not indented.


If images seem to be off-center maybe you forgot to reset
the insets to setInsets="0,0,0,0".

The default settings was used to prevent text getting flushed
to the border edges, which would fuse the border to the text.

Back    Next