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:

Graphical user interface, application

Description automatically generated

If you leave out the argument GUI4sher will give you a type error and not do anything as shown below:

Graphical user interface, application, Word

Description automatically generated

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.

Graphical user interface, application, Word

Description automatically generated

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:

Graphical user interface, application, Word

Description automatically generated

You can have a font name and a size:

Graphical user interface, application, Word

Description automatically generated

Graphical user interface, application, Word

Description automatically generated

You can also follow the name and the size with italic or bold.

Graphical user interface, application, Word

Description automatically generated

You can also use outline= or font= to control the color and font of a new label.

Graphical user interface, text, application

Description automatically generated

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.

Graphical user interface, application, Word

Description automatically generated

Then you can place a corrected label in the project:

Graphical user interface, text, application

Description automatically generated

You can modify the text in a label using the set_text method which takes the new string as an argument.

Graphical user interface, text, application

Description automatically generated

Click to see how to place and use clickable buttons in a GUI4sher project

Contents

·      GUI4sher How To

o   Downloading

o   Starting a new project

·      The Structure of a GUI4sher project

·      Adding Geometric Objects to a GUI4sher Project

o   Geometric Object

o   Rectangles

o   Modifying Colors and Borders

·      Ovals and Lines[SD1] 

o   Ovals

o   Lines

o   Polygons

·      Labels: Putting Words on GUI4sher

·      Buttons: Simple User Input

o   Simple Button

o   Counting Button

o   Check

·      Entering Text

o   Entries

o   Text

o   Creating an App

·      Lists in GUI4sher

o   List for Selecting a String

o   Editable List of Numbers

·       Project Administration

o   Copyright and Thanks

o   Debugging

 


 [SD1]