lyle at knology.net
2006-Jun-07 14:49 UTC
[fxruby-users] How to determine width and height of FXImageView?
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, > LAYOUT_FILL_X|LAYOUT_FILL_Y) > > 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.