Hi, I was trying to change the icons of a button when the
mouse moves over the button, and when it moves out again.
I was trying to use set_image but I recieved a little error.
Unsure whether this could be a bug, here is an
example script (you probably need to use some
own Images)
SCRIPT START
require ‘gtk2’
make button that holds first image
button = Gtk::Button.new()
this_image = Gtk::Image.new(‘/foobar.png’)
assign 2 extra images
second_image = Gtk::Image.new(‘/foobar1.jpg’)
third_image = Gtk::Image.new(‘/foobar2.jpg’)
button.set_image this_image
button.set_image second_image
button.set_image third_image
button.set_image this_image
button.set_image second_image
add the things up
w=Gtk::Window.new
w.add(button)
w.show_all
Gtk.main
SCRIPT END
The error I recieve is:
image_test.rb
(eval):5:in set_property': destroyed GLib::Object (TypeError) from (eval):5:in
set_image’
from image_test.rb:14
In another script where I try to use
set_image to get a new image, a similar error happens:
in set_property': destroyed GLib::Object from (eval):5:in
set_image’
(On a sidenote, I was trying to change the icon of
a button when the mouse hovers over the button, and when
hovers out again, just like in Javascript. I am still not
sure how to properly do this in ruby-gnome)
–
Get your free email from http://www.linuxmail.org
Powered by Outblaze
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642