Q: Resizing Fixeds




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. 

My assumption is that I'll need to futz around with size_request or
size_allocate events to fix this, but I'm not sure where to start. 

(Also, I have one minor complaint about GLArea, although I'm not sure
where the problem lies: repaints of a damaged GLArea first repaint in the
window background color, and then repaint from the GL context. It might
look better if the background repaint was skipped. Or might not. <shrug>)

Thanks,
Ken
-- 
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)





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