Re: forcing immediate redraws?



On Tue, 8 Aug 2000, Gary Scavone wrote:

 Hi, 

 You should add the following after each of gtk_widget_set_state:

while (gtk_events_pending())
        gtk_main_iteration();
 
 Note: user will be able to interact with other widgets then (i.e. press
other button), so probably you will have to disable them!

> 
> I have an app in which buttons are associated with sounds. I need to
> offer a feature such that a sound is played and its corresponding
> button is "highlighted" during playback only.
> 
> I have a little routine that looks roughly like this:
> 
>   gtk_widget_set_state ( button, GTK_STATE_ACTIVE );
>   play_button_sound ( button );
>   gtk_widget_set_state ( button, GTK_STATE_NORMAL );
> 
> Unfortunately, the drawing of the button doesn't seem to happen until
> I leave my routine and return to the gtk_main() loop.  Is there a way
> to force the redraw to happen immediately?
> 
> 

 Best regards,
  -Vlad





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