Labels: Putting Words on GUI4sher
The place_label function adds words to a GUI4sher project. The place_label function requires an argument which is a quoted string containing all the words to put on the project. An example of using place_label is below:
If you leave out the argument GUI4sher will give you a type error and not do anything as shown below:
All of the previous place functions did not require arguments but the rest of the place functions need them.
The label has methods, set_fill and set_outline which controls the text color.
There is also a method called set_font which has an argument that contains a font.
A font could just be a font name as shown below:
You can have a font name and a size:
You can also follow the name and the size with italic or bold.
You can also use outline= or font= to control the color and font of a new label.
If your are not careful like in the example above the end of the label might be beyond the edge of the GUI4sher project. One way to deal with this is to undraw the label. You can undraw anything in GUI4sher and it will be removed.
Then you can place a corrected label in the project:
You can modify the text in a label using the set_text method which takes the new string as an argument.
Contents