Re: Converting signal code from RubyGTK to Gtkmm

Thanks guys, that was perfect.  :)  Here is the final working code, please
let me know if there is a better way to do it.  

// Image object class
class draw_image
  draw_image( Gtk::DrawingArea* widget, unsigned char* image, const int
        const int height ) :
      widget( widget ),
      image( image ),
      width( width ),
      height( height )
    widget->signal_expose_event().connect( sigc::mem_fun(
      *this, &draw_image::on_expose_event ), false );

  bool on_expose_event( GdkEventExpose* event )
    widget->get_window()->draw_rgb_image( widget->get_style()->get_fg_gc(
       Gtk::STATE_NORMAL), 0,0, width, height, Gdk::RGB_DITHER_NONE,
       image, width*3 );
    return true;

  Gtk::DrawingArea* widget;
  unsigned char* image;
  const int width;
  const int height;

View this message in context:
Sent from the Gtkmm mailing list archive at

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