Re: Gtk::DrawingArea

Ian Strascina wrote:

Hi, I'm trying to capture a click inside a Gtk::DrawingArea to create a
simple "painting" app (by drawing a pixel and the clicked location)...
Since they DrawingArea itself does not have any specific signals, I
attempted to use both the 'signal_event()' and
'signal_button_press_event()' signals (w/in Gtk::Widget) without
success...  I've been looking at the documentation for the last hour
and can't find any other possibilities...  Does anyone know how to do
this...???  Am I missing something really simple...???

        - Ian

"Should array indices start at 0 or 1???  My compromise of 0.5 was
  rejected without, I thought, proper consideration..."
        -- Stan Kelly-Bootle
gtkmm-list mailing list
gtkmm-list gnome org <mailto:>

i would suggest you to inherit your class from a Gtk::DrawingArea and then override on_button_press_event(GdkEventButton*); this function is inherited from Gtk::Widget, so you don't see it in the Gtk::DrawingArea ducumentation unless you select "view all members". maybe you'll also find on_key_press_event(GdkEventKey*) usefull. besides, and that's the most important part of my answer, you should look at, where you get some more general info about drawing areas and so on. If you don't know how to use the various GdkEvent... structs, just take a look at where you can find detailed information about them. at last, you should also that a look at Gtk::Layout which is somekind of DrawingArea with scrolling support.

hope that helps,

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