Re: [gtkmm] Update graphical interface in loop;
- From: "Timothy M. Shead" <tshead k-3d com>
- To: Rogério Samuel de Moura Martins <rsmm netu unisinos br>
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] Update graphical interface in loop;
- Date: Tue, 12 Oct 2004 08:50:02 -0700
Rogério Samuel de Moura Martins wrote:
I create a loop:
for(int i = 0; i < 100; ++i) {
m_Label.setLabel((string)i);
}
but the interface not update in looping.
what commnad insert to udpdate inteface?
for(int i = 0; i < 100; ++i) {
m_Label.setLabel((string)i);
//>>> command for update interface;
}
Remember that your code executes when gtkmm calls your event handlers,
not the other way around. Under normal circumstances, state changes to
widgets will not cause screen updates until your event handler returns
control to gtkmm. You can give gtkmm a chance to execute by inserting
while(Gtk::Main::events_pending())
Gtk::Main::iteration();
into your loop.
Cheers,
Tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]