Re: Displaying intermediate button images.



This is just a guess since I'm not in front of my development workstation.  You need
to call the main GTK loop while you sleep.  Invalidated regions of the screen get
painted by the idle handler in the main loop.  From the looks of it you sleep
function doesn't call the main loop before it sleeps.

Given that your sleeping for a total of 2 seconds, which is an eternity from a UI
standpoint.  I would probably setup some main loop timmer callbacks to update the
button.  Look at:
 http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html#g-timeout-add

If you don't want to use the built in main loop timers, try calling
gdk_window_process_updates () before you sleep.

I have a button. When it's clicked, I want to toggle
the image that's displayed as the label on the button.
I want to toggle it four times, pausing for half a
second between each toggle. The trouble is only the
final image is being shown.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]