Converting signal code from RubyGTK to Gtkmm



Hi everyone,

Just a caveat before I continue, I'm new to C++ so I'm jumping in with both
feet by adding in Gtkmm.  :)  I have a Ruby application that uses GTK to
display an image being generated via OpenCL, so I created an expose_event
signal to handle the image update redraw.  I'm having all sorts of problems
finding good documentation/tutorials on Gtkmm signals or even documentation
on the gtk::image widget.  I'm also using Glade and builder to construct the
interface. Here is the Ruby code I'm using that I would like to convert to
Gtkmm:

$image.signal_connect('expose_event') do
    if $rgb == nil || $rgb.length != $iwidth*$iheight*3
        puts 'rgb buffer is null or wrong length'
    else
        Gdk::RGB.draw_rgb_image($image.window,
$image.style.fg_gc($image.state),
            0, 0, $iwidth, $iheight,
            Gdk::RGB::Dither::NORMAL, $rgb, $iwidth*3, 0, 0)
    end
end

$image is the image widget that is from the builder object.
$rgb is the 8-bit rgb image.
$iwidth and $iheight is the image dimensions.

Any help or links to some documentation would be great.  I thought that
RubyGTK documentation was bad, Gtkmm is so much worse. :(

Jason
-- 
View this message in context: http://old.nabble.com/Converting-signal-code-from-RubyGTK-to-Gtkmm-tp29123779p29123779.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]