Re: Gtkmm widgets don't always update...
- From: rob <rob robstoddard com>
- To: gtkmm-list gnome org, Rob Arnold <rob telanetix com>
- Subject: Re: Gtkmm widgets don't always update...
- Date: Thu, 17 Jan 2008 12:39:54 -0800
I figured it out, all thanks to the fact that gtkglextmm wouldn't build
on my machine at home. That twisted my arm to
find another demo that would work on that machine. The reason why the
glgears demo wouldn't work, and consequently,
since I modelled the OpenGL portions of the code for my application off
of the glgears demo, is because of this little piece of code:
void invalidate() {
Gdk::Rectangle allocation = get_allocation();
get_window()->invalidate_rect(allocation, false);
}
The problem here is that the allocation rect that is delivered has the
position, width and height of the widget with respect to
the parent widget. This, however, asks Gtk/Gdk to invalidate the rect
with respect to the widget's coordinates, which causes the widget
to not update because it has no content in that area. The correct code
would/should have been:
void invalidate() {
Gdk::Rectangle allocation(0,0, get_allocation().get_width(),
get_allocation().get_height());
get_window()->invalidate_rect(allocation, false);
}
Thank you for your time and attention,
Rob Stoddard
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]