Re: XForms: Segmentation Faults with C++

Thomas Thiel (wolfchild@home.ivm.de)
Thu, 25 Feb 1999 14:38:50

# To subscribers of the xforms list from Thomas Thiel <wolfchild@home.ivm.de> :

At 11:14 25.02.1999 +0000, you wrote:

First at all: Thanx for the fast answer !

>Hi again (sorry for the 2-stage answer...),
No prob, my fault....

>I added in an:
[...]

Ok, after messing around with these suggestions I realized that my problem
lies in an other part of my app. :)

Do you know what's wrong with the following code ?

Class definition:

class IF_Spielfeld_Class
{

private:

FL_FORM *IF_Form;
FL_OBJECT *Fieldbuttons[12][12];

public:

IF_Spielfeld_Class();
~IF_Spielfeld_Class();
SetFieldPixmap(unsigned char X, unsigned char Y, unsigned char Type,
unsigned char Heading);

};

Class implemetation of the Constructor:

IF_Spielfeld_Class::IF_Spielfeld_Class()
{

[... Form-definition ]

int counter1,counter2;

for (counter1=1;counter1<=12;counter1++)
{
for (counter2=1;counter2<=12;counter2++)
{

Fieldbuttons[counter1][counter2]=fl_add_pixmap(FL_NORMAL_PIXMAP,-20+counter1
*41,-20+counter2*41,41,41,NULL);
fl_set_pixmap_data(Feldbuttons[counter1][counter2],Normal_xpm);
};
};

[... Rest of Form-Definition, displaying form etc.]

};

What do you think ?

>and it runs (the result is not nice :).
The code you have read is considered as at an early alpha stadium.... :)

___

Greetz,

---> Lord Wolfchild <---
[wolfchild@home.ivm.de]
_________________________________________________
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/