how do i force a window to be fully realized ?



deep within the bowels of my application, i do a whole heap of GTK+
calls that queue up a vast amount of stuff for GTK/X to do. before i
purposefully finish it all and let GTK do its work, i need to get the
size and origin of some of the windows that have been "created".

it turns out that sometimes the window isn't realized, so i do this:

        // Gtk_Widget::get_window => gtk_widget_get_window ()

	while ((win = get_window ()) == 0) { 
		gtk_ui->flush_pending ();
	}		

where Gtk_UI::flush_pending() does the usual:

	while (gtk_events_pending())
		gtk_main_iteration();

however, even this is not enough: i then call

	gdk_window_get_size (win, &h, &w);
	gdk_window_get_origin (win, &x, &y);

and i can still get nonsense answers to both of them.

worse still, it seems pretty easy to send the program into an endless
loop with the top loop - the window returned by get_window () is
sometimes NULL repeatedly, and no attempt to give GTK a chance to
catch up succeeds.

clues ?

--p





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