Re: Q: Resizing Fixeds




Kenneth Albanowski <kjahds@kjahds.com> writes:

> I've got a toplevel, containing a Fixed, containing a GLArea. (I need the
> fixed because I also need to overlay sub-GLArea's on top of the primary
> one for the window. Anyone familiar with Glut will know what I'm aiming
> for.) Unfortunately, I haven't been able to get the GLArea to properly
> track the resizing of the toplevel. The closest I've come is with this
> logic:
> 
> 	window = new toplevel window;
> 
> 	fixed = new fixed;
> 	fixed->show;
> 	window->add(fixed);
> 
> 	glarea = new glarea;
> 	glarea->show;
> 	fixed->put(glarea, 0, 0);
> 
> 	window->set_policy(1, 1, 0);
> 	window->signal_connect(configure_event => {
> 		glarea->set_usize(window->allocation->width,
> 				window->allocation->height);
> 	})
> 
> 	window->show;
> 
> Unfortunately, this seems to be working on the wrong side of the event
> loop, as the resize of the glarea (and its containing Fixed, I assume)
> doesn't take place until the _next_ resize of the glarea. The glarea is
> always one step behind the window size. 

"configure_event" is, like all event signals, RUN_LAST. That
means that you get the event before GtkWindow does, so at
that point, window->allocation has not yet been set.

Either use event->height/width instead, or 
connect to size_allocate instead. 
 
Regards,
                                        Owen



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