Re: ReFreshing a Window



En/na Dimitri Holz ha escrit:
I use a resize() - methode to change a size of my window, but I do it in a do-while-trails to see the change-effect:

void MyWindow::change_size()
{
    int x=100, y=100;
        do
{ MyWindow::resize(x, y);
            .......................................................
            x++;
            y++;
}while(x<800||y<800); }

but the problem is that you see only the first and the last size and I can`t find a GtKmm-methode for refresh a window like ::refresh() ; or ::reload() or so. How can I solve this problem?
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



When a widget (including your window) is resized, the widget generates an event to be redrawn, so the call to 'queue_redraw()' to force the redraw of the window is not needed.

The problem is in your code: In a simple loop you are performing many resize operations. Gtk and GTKmm is working based on events, so every time you call to resize, an event is generated and queued, and all generated events are processed once the loop is finished (the control returns to main loop and new events are processed).

You should change the implementation of your function and use a timer, in which at every timer callback an update should be done. For more information:

http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-chapter-timeouts.html#sec-timeouts

Joaquim Duran
Thanks and Best Regards,



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