images in FXRuby

R

Raj Sahae

I'm new to FXRuby, and I'm having a problem with displaying images. I'm
simply trying to display an image in a vertical scroll window, with the
end result being a program that shows multiple images with vertical
scrolling. I can get button icons to work just fine. I have tried
using both FXImageView and FXImageFrame. What am I doing wrong? A
sample of my code is:

require 'fox16'
include Fox
theApp = FXApp.new

imageFile = File.open("gm.jpg", "rb")
theMainWindow = FXMainWindow.new(theApp, "Hello", nil, nil, DECOR_ALL,
400, 400)
firstWindow = FXScrollArea.new(theMainWindow,
VSCROLLER_ALWAYS|LAYOUT_FILL_X|LAYOUT_FILL_Y)
image = FXJPGIcon.new(theApp, imageFile.read)
imageView = FXImageView.new(firstWindow, image)

theApp.create
theMainWindow.show
theApp.run
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top