Re: XForms: FDESIGN bug ?!?

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 27 Oct 97 06:27:16 PST

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

> > > I tried to make some bitmap/pixmap buttons with FDESIGN.
> > > WhenI used Pixmap Data Pixmap width Pixmap height instead of Pixmap
> > > file , I caught a strange error message.
> > > Why ?
> >
> > What's the error message?
>
> So ,
> On the stderr : In SetPixmapData [pixmap.c 543] is not
> Pixmap/pixmapbutton class
>
> ,and it appeared in an allert box too.
>
> First I ignored the message, and saved the form. But,when I reload it the
> fdesign forgot the values.

You just want to give fdesign the name of the pointer to XPM data
you're going to use.

For instance, if you specified the name `foobar', you would need to
have accessable to the form creation routine a pointer to array of
char named `foobar'.

You would generally do this in an include file which is known to the
creation code generated by fdesign. Since you don't want to have to
edit the fdesign generated file every time you fiddle with the form's
layout, you should use the -I command line argument to give an
alternate include file:

fdesign -I my_include.h my_form

This will cause fdesign to emit a `my_form.c' file as follows:

/* Form definition file generated with fdesign. */

#include "my_include.h"
#include <stdlib.h>
#include "my_form.h"

FD_my_form *create_form_my_form(void)

[...]

You would then create a file called `my_include.h' and put in it,
among anything else

#include <forms.h>

#include "foobar.xpm"

[...]

(assuming that's the name of your XPM file).

Within `foobar.xpm' you'd have standard XPM pixmap data. For instance

/* XPM */
static char * foobar[] = {
"64 64 2 1",
" c #0080FF",
". c black",
[... lines generated by your favorite XPM converter/editor ...]

specifies a simple 64 x 64 XPM pixmap.

You don't need to specify the pixmap dimensions explicitly, other than
in the size of the Pixmap button, since XPM and XForms will deal with
them correctly as implicitly specified in the XPM format data.

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