[FONT=Arial]
image1 = TkPhotoImage.new { file "img1.gif" }
image2 = TkPhotoImage.new { file "img2.gif" }
b = TkButton.new(@root) {
image image1
command proc { doit }
}
b.bind("Enter") { b.configure('image'=>image2) }
b.bind("Leave") { b.configure('image'=>image1) }
where in the hierarchy of files, say C:\ruby\lib, would I put the image for being used in my program?? Like where it says file? would i put there the path name to my image file.
ruby images
Page 1 of 12 Replies - 11432 Views - Last Post: 10 March 2007 - 11:58 PM
Replies To: ruby images
#2
Re: ruby images
Posted 08 May 2006 - 06:03 PM
You'll specify the path right before the actual file name of your image...the example you have currently shown presumes that the image file is in the same directory as the script. You can either path absolutely
or relatively
"C:\dir1\dir2\images\img1.gif"
or relatively
"../images/img1.gif"
#3
Re: ruby images
Posted 10 March 2007 - 11:58 PM
hi,
I think this from book "Programming Ruby": Sample Code for page 260,
in this example, img1.gif and img2.gif at the same path of source code.
I think this from book "Programming Ruby": Sample Code for page 260,
in this example, img1.gif and img2.gif at the same path of source code.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|