Re: Strange behavior



On 6/11/07, Robert Caryl <bob fis-cal com> wrote:
We have encountered a strange problem:

We derive a window from Gtk::Window.  We add three Gtk::HBox containers
to the window.  In the first we pack three Gtk::Label objects, each of
which display some status text.  In the second we have a dynamically
created menu.  In the third we have a Gtk::DrawingArea.  We have
overridden the Gtk::Window::on_expose_event to rescale a Gtk::Image and
render that image into the Gtk::DrawingArea.

That's an interesting choice on how to get the image rendered into the
drawing area. Is there a particular reason that you didn't choose to
override the expose-event virtual method of Gtk::DrawingArea instead?


Here is the strange behavior:  When we allow the Gtk::Image to be
rendered into the Gtk::DrawingArea, the Gtk::Label objects in the first
Gtk::HBox are not displayed (or perhaps they are obscured).  If I
comment out the code in the Gtk::Window::on_expose_event, the Gtk::Label
objects in the first Gtk::HBox are displayed.  The menu in the second
Gtk::HBox is unaffected in both cases.

Just a stab: if your expose handler for the toplevel Window looked like:

 bool
 on_expose_event(GdkEventExpose* e)
 {
   Gtk::Window::on_expose_event(e);

   draw_image_onto_drawing_area();
   return true;
 }

then any work you do after the chain up to the base class code, is
going to stomp on the children widgets' painting. As for why the menu
still appears, perhaps it uses a dedicated GdkWindow (I don't have the
code handy to look at right now). Widgets that do their rendering to
an independent native window will still survive an unorthodox ordering
like the code above.


I know someone is going to ask for the code, but until my co-worker
arrives I cannot comply.  Any ideas?

--

*Robert L. Caryl Jr.*
Fiscal Systems, Inc.
102 Commerce Circle
Madison, AL 35758-2706 USA
256-772-8922 ext. 108

/This e-mail message may contain privileged or confidential information. If you are not the intended recipient,
you may not disclose, use, disseminate, distribute, copy or relay this message or attachment in any way.
If you received this e-mail message in error, please return by forwarding the message and it's attachment
to the sender and then delete the message and it's attachment from your computer./

/Neither Fiscal Systems, Inc., nor its affiliates, accept any liability for any errors, omissions, corruption
or viruses in the contents of this message or any attachments that arise as a result of e-mail transmission./


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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