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
  {
  public:
  draw_image( Gtk::DrawingArea* widget, unsigned char* image, const int
width,
        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 );
    }

  private:
  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;
  };


Jason
-- 
View this message in context: http://old.nabble.com/Converting-signal-code-from-RubyGTK-to-Gtkmm-tp29123779p29330488.html
Sent from the Gtkmm mailing list archive at Nabble.com.



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