google-code-export / simple-pygame-gui

Automatically exported from code.google.com/p/simple-pygame-gui
1 stars 1 forks source link

Exception raised when an empty desktop is clicked #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run a test program displaying a desktop with no widgets
2. click on the background
3.

What is the expected output? What do you see instead?
Nothing should happen, but instead the program crashes with the following 
error:

File "/home/ostsol/src/spg-src-0.9.2/gui.py", line 574, in update
    if self.focused and self.focused != self:
AttributeError: Desktop instance has no attribute 'focused'

What version of the product are you using? On what operating system?
0.9.2 on Kubuntu Intrepid

Please provide any additional information below.
Analysis: The 'focused' attribute in the desktop class is not initialised 
until a widget is added.
Solution: Initialise it to 'self' or 'None' in the constructor (line 517 
in 'gui.py')

Original issue reported on code.google.com by Ost...@gmail.com on 5 Apr 2009 at 4:15