Project Administration

Copyright and Thanks

When a complex project is completed like the editable list of numbers, the programmer might want to benefit from their efforts.  Copyright gives the programmer legal protection from unscrupulous individuals or corporations using a programmers work without compensation.  The add_author function allows the programmer to put their name on the copyright notice on the bottom of the project.  Update year makes the Copyright notice use the current year rather than the year that GUI4sher was written. 

Graphical user interface, application

Description automatically generated

Sometimes a programmer will want to acknowledge help from someone but not give them ownership.  The programmer can acknowledge helpers with the add_thanks function.

Graphical user interface, application

Description automatically generated

Debugging

When a widget function is complex it can be difficult to debug.  You can use the say function to write messages to the shell screen, so you can see whether the right lines are executing and what the values of variables are.  In the example below there are several errors:

A picture containing text

Description automatically generated

Below we see that there is a name error on the last line, circle is spelled wrong. Once we fix that we can see that the code won’t change the fill from the empty (unfilled).  If we fix that:

Chart

Description automatically generated with medium confidence

Chart

Description automatically generated with medium confidence

At this point the project detected the misspelling in the clicks file.  Once it is fixed:

Chart

Description automatically generated

The output to the shell shows that the project is working correctly.  The last step is to comment out the debugging code:

def change_button_click():

      #say('Circle has fill: '+color_circle.get_fill())

      if color_circle.get_fill() == '':

            color_circle.set_fill('green')

      elif color_circle.get_fill() == 'green':

            color_circle.set_fill('blue')

      elif color_circle.get_fill() =='Blue':

            color_circle.set_fill('red')

      else: color_circle.set_fill('')

If further debugging needs to be done you can remove the # and the debugging helper statement is still there.

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]