Re: XForms: Size of the Pixmap

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 18 Nov 99 13:25:43 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> How i can know the size of a XPM after assign it to
> a pixmap in xforms?

That information isn't available directly but you can get it by using
fl_read_pixmapfile() to read the XPM data and create a Pixmap. YOu
can then use fl_set_pixmap_pixmap() to assign the Pixmap to the
object, after which you can do your resize.

You should remember to free the old Pixmap(s) with fl_free_pixmap().

You could do something of the nature of the following:

Pixmap pixmap;
Pixmap shape_mask;
unsigned width;
unsigned height;

fl_get_pixmap_pixmap( obj, &pixmap, &shape_mask );
if ( pixmap )
fl_free_pixmap( pixmap );
if ( shape_mask )
fl_free_pixmap( shape_mask );

pixmap = fl_read_pixmap_file( ... &width, &height, &shape_mask, ... );
fl_set_pixmap_pixmap( obj, pixmap, shape_mask );

resize_the_form( width, height, ... );

> Thanx. The look of xforms is not as beatiful (better
> say modern) as Qt or GTK... but each time i work with
> it i like more its feeling. Keep on good work (and do
> it GPL!).

Tis in the eye of the beholder. ;-)

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/