Find referring form : problem

Martin East (ceeme@cee.hw.ac.uk)
Thu, 15 May 1997 14:12:39 +0100 (BST)

To subscribers of the xforms list from Martin East <ceeme@cee.hw.ac.uk> :

I've tried to implement the simpler of the two solutions suggested to test the
theory and to get my head around it. (not the "context" solution - will try
this later if time allows).

Everything compiles fine.

(My program displays a custom sample object with a zoom bar and a positioner
bar - the zoom manipulates the sample object and the position bar. While the
position bar manipulates only the sample object.)

When I try to move one of my sliders it gives me an error (which has a dismiss
button on it) saying that the object passed is not a "slider" type...

If I remove all but the redraw for the position

It is declared ok in the FD FORM structure as far as I can see.

The code in the form create function is:

{

FD_Main_Sound *fdui= (... calloc)

...
...
...

fdui->xsample1_obj = obj =fl_add_xsample(FL_NORMAL_XSAMPLE,64,40,620,244,"");

fdui->zoom1_vs = obj = fl_add_valslider(FL_VERT_SLIDER,20,40,32,244,"Zoom");
fl_set_object_lsize(obj,FL_NORMAL_SIZE);
fl_set_object_callback(obj,zoom1_vs_cb,0);
fl_set_slider_value(obj, 1.00);
fl_set_slider_bounds(obj,0.01,1.00);
fl_set_slider_return(obj, FL_RETURN_CHANGED);

fdui->position1_s = obj = fl_add_slider(FL_HOR_SLIDER,64,296,620,24,"Position");
fl_set_object_lsize(obj,FL_NORMAL_SIZE);
fl_set_object_callback(obj,position_s_cb,0);
fl_set_slider_return(obj, FL_RETURN_CHANGED);
fl_end_form();

}

My callback for the zoom1_vs_cb function uses the cross referencing to the
form from the object stuff already posted.

void zoom1_vs_cb(FL_OBJECT *ob, long data)
{
...
...
...
FD_Main_Sound *fdui= (FD_Main_Sound*)ob->form;
...
...
...

// I then use this to access the xsample1_obj eg.

SampleSize=fl_get_xsample_SampleSize(fdui->xsample1_obj);

// seems to work fine.

// Later in the program I do the same using a "set" funnction for position1_s

fl_set_slider_bounds(fdui->position1_s,0,SampleSize-NewdisplayDuration);

// And this bombs out. giving the error described then a core dump.

}

I really do appreciate any help. This is dissertation work and I've got
deadlines in 3 weeks.. :(

Thank you for the posts already given.

I hope when I get more experience on XForms I will be able to contribute more
to answers + bug reports.

I also must say that this is allot easier than Motif - this I am thankful for!

Cheers.

Martin East
ceeme@cee.hw.ac.uk

(sig has been deleted accidentally)

_________________________________________________
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/xforms-archive/