[gtkmm] Need help with Gtk::DrawingArea



Hello!

I am now trying to figure out how the Gtk::DrawingArea works. The documentation 
seems to be out of date in regards to this area, particularly with respect to 
Gtkmm2.2

I found one working example (the drawingarea.cc) in the /examples directory, 
and am trying to figure out how it works.  So far, here is what I understand, 
feel free to jump in if I am incorrect:

The on_realize() method gets inherited from Gtk::Widget and gets called when 
the DrawingArea is first instantiated.

The on_expose_event() method gets inherited also from Gtk::Widget and gets 
called when the widget needs to be redrawn.

Now, my questions are below:
(1) In the example, the overridden on_realize() method is calling it's 
baseclass on_realize() method.  Why is this not necessary for the 
on_expose_event() method?  Does the base class method for on_expose_event() 
perform no useful function?

(2) What is the difference between a Pixmap and a Pixbuf?  In what cases should 
we prefer one over the other?  Also, it seems like the pixbuf class has more 
member functions for copying portions of the pixbuf to a Gtk::DrawingArea, 
while the pixmap lacks many of these functions.  Is there a reason why?

I'm hoping that once I fully understand Drawing in Gtkmm2.2, I can help update 
the documentation.

Thanks Again!


-- 
Gene Ruebsamen
Downey Savings, Inc.

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



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