Winshow quit method

15 views
Skip to first unread message

Francois Chartier

unread,
Feb 15, 2014, 3:05:59 PM2/15/14
to jbr...@googlegroups.com
Hello jbrout coders

I've  implemented a slideshow in jbrout full screen view (winshow.py), using glib add_timeout_seconds method, and a callback function in WinShow. It's controlled with F* keys and keypad, and works rather well, but I have one remaining problem:

When I exit the full screen window while the slideshow is activated, the timer still calls the callback function, which causes an exception. I can catch it, but I'd rather avoid the exception altogether. 

I can't seem to be able to intercept the quit() method, though. I tried to override it and call the super method (from GladeApp), but id didn't work, and changing the explicit calls don"t seem to work right either (there seem to be implicit calls too)... I'm not sure I understand too well theses windows. Is the WinShow destroyed when the window is closed ?

Any idea of a reliable method I could use to determine if the fullscreen window is open or closed ?

I attached my currently modified version of winshow.py

My exception:

Traceback (most recent call last):
  File "/home/narf/jbrout.git/jbrout/winshow.py", line 122, in __on_tick
    rc = self.__callback_on_tick()
  File "/home/narf/jbrout.git/jbrout/winshow.py", line 478, in show_next
    self.draw()
  File "/home/narf/jbrout.git/jbrout/winshow.py", line 333, in draw
    self.main_widget.window.set_cursor(cursor)
AttributeError: 'NoneType' object has no attribute 'set_cursor'


François

winshow.py
Reply all
Reply to author
Forward
0 new messages