Fade out Label / Button / Status Bar with GTK

Posted by wolfv on Ask Ubuntu See other posts from Ask Ubuntu or by wolfv
Published on 2012-08-27T20:35:09Z Indexed on 2012/09/30 9:48 UTC
Read the original article Hit count: 406

Filed under:
|
|
|

What is the easiest way to fade out and fade in elements in Python / GTK 3?

Coming from webdevelopment, my initial take on this problem was to call

c = widget.get_style_context(), c.remove_class('visible'), c.add_class('invisible')

but that didn't work out (Do I have to call something like "redraw"?)

I also added a transition to the GTK CSS.

Thanks,

Wolf

EDIT: I might specify what I would like to achieve: I have this "statusbar" which is just a vertical container on my app (like in the screenshot on top of this page http://uberwriter.wolfvollprecht.de/).

If the mouse is not moving, I want to fade all that stuff out (also to preserve computing power // no recalculation of word- and char count) and to minimize "distraction"). I already found the appropriate event to listen to (motion-notify-event), so now I only need to add a simple fade out and a timeout.

If someone can point me to a solution, be it with clutter or cairo, I would be very happy.

© Ask Ubuntu or respective owner

Related posts about python

Related posts about gtk