Re: [gtkmm] Update graphical interface in loop;




thanks to all:

B.Hakvoort wrote:

Hey, try using

while (Gtk::Main::events_pending())  Gtk::Main::iteration();

To handle all pending gui events, before proceeding to next loop.

Bart

On Tue, 2004-10-12 at 12:32 -0300, 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;
   }

thanks#

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Timothy M. Shead wrote:

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]