[fxruby-users] How to determine width and height of FXImageView?

lyle at knology.net lyle at knology.net
Wed Jun 7 10:49:19 EDT 2006

On Wed, 07 Jun 2006 16:38:43 +0200, "Axel Etzold" <AEtzold at gmx.de> wrote :

> In one field of an FX4Splitter, I want to display a PNG
> image.
> I know how to do this (basically) from the imageviewer.rb
> file.
> But the image I display needs to be generated first
> (by Gnuplot ... no problem to output PNG from there,
> except one: to set the size : I don't know what
> to tell Gnuplot there:
> - how do I see what the size of that
>  @imageview_rec = FXImageView.new(@topFrame_rec, nil, nil, 0,
> is ?
> I tried   
>     p @imageview_rec.getHeight
>     p @imageview_rec.getWidth
> but that gives me 1 and 1.

The FXImageView widget isn't going to have a known size until it's created,
and I'm guessing you're calling getHeight() and getWidth() before that happens.

More information about the fxruby-users mailing list