Re: [gtkmm] How to update a widget's display



>	Hello
>
>I have the following code but I don't know how to update the display of the st
>atusbar because it only displays the last one ("Text n°999") but not all the ot
>hers!

unfortunately, your design reveals a very common error in the way
people think about programming with GUIs. 

operations that "should" change the visible state of a widget will
have no effect until control is returned to the main GUI event
loop. redrawing doesn't happen until then. this is true of GUI
toolkits, even those on other operating systems.

i believe that you have two options. either rethink what you are
trying to do here (recommended), perhaps using a timer. or add a call
to gtk_main_iteration() (or its gtkmm equivalent) after each pair of
pop/push calls. gtk_main_iteration() runs the main event loop
recursively, picking up any pending work that needs doing (such as
redisplaying your widget.

--p



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