Alfio Puglisi 1 year ago
3 changed files with 10 additions and 5 deletions
  1. 3 0
  2. 2 0
  3. 5 5

+ 3 - 0

@@ -14,6 +14,9 @@ Guietta is a tool that makes simple GUIs *simple*:
       [  _               ,    _     ,  _  ,    _   ,      Quit      ]
+    with gui.Calculate:
+        gui.result = float(gui.a) + float(gui.b)

+ 2 - 0

@@ -8,6 +8,8 @@ using conda::
   conda install -c conda-forge pyside2
+This command sometimes takes a lot of time to complete. Give it time.
 Long version:
 pip and conda do not work well together. In particular, Conda ships

+ 5 - 5

@@ -93,7 +93,7 @@ are kept, and everything else is removed.
 The GUI shown in the previous chapter will have five widgets: 
 "Enternumber", "num", "Go", "Result", and "result". If a name is a duplicate,
-it is auto-numbered starting with the number2.
+it is auto-numbered starting with the number 2.
 All widgets are available in the `widgets` dictionary, so it is possible
 to use all ordinary QT methods::
@@ -129,7 +129,7 @@ editbox::
   gui.num = gui.Go
 Guietta's properties are guaranteed to always use strings: whatever is
-displayed is converted to as string using the str() built-in function.
+displayed is converted to as string using the str() built-in.
 Reading from a property will return either a string, or a list of strings,
 or a dictionary where both keys and values are strings.
@@ -229,7 +229,7 @@ Notice that the *auto* decorator is a member of a *Gui* instance, and not
 a standalone one. Thus any decorated function must be declared after
 the gui is constructed.
-.. note:: due to how the code instrospection features work (from the 
+.. note:: due to how the code introspection features work (from the 
           standard library
           `inspect <>`_
           module) the @auto decorator will not work on the
@@ -372,7 +372,8 @@ If you have tried the previous code clicking *Go* without entering
 a number before, or entering something else like a letter, the loop
 will have exited with an exception caused by the failed *float()* call.
-This teaches us an important lesson: when using *get()*, we should be
+This happens because, when using *get()*, the exception catching described
+above is not used. Instead, we should be
 prepared to catch any exception generated by the code. Rather than using
 a big try/except for the whole loop, it is best to put the the exception
 handling right where it is needed, in order to be able to display a
@@ -385,7 +386,6 @@ meaningful error message to the user. Something like this::
                    gui.result = e
 Notice how we are displaying the error message right in the GUI.
-Later on we will encounter more flexible ways to handle exceptions.
 Non-blocking *get*