> > > I put together the following code for test purposes, it is=20 > > not a full implementation with error checking etc or a final=20 > > design, it just lets me practice with some of the elements i=20 > > will need. it compiles fine i just renamed some of the=20 > > variables before posting, i can't compile and test in work,=20 > > so excuse any typos i will update any that remain but i think it's ok. > > Your code doesn't compile for me - there are a couple of issues. I > bodged around to get what I thought you meant, but... > > Anyway, they main stopper (apart from the absence of the #include lines > you are using) is that gcc complains that the variable "Reset" is > ambiguous - you have a button widget and a void function with the same > name declared in your class and gcc does not like it when it is > subsequently called and can't be uniquely resolved. > > I changed the name of the function (and the places from which it is > called) to reset_fn. > > > The other possible issue is that your outer function "SetupTest" does > not derive from Fl_Widget (or better Fl_Window), yet in your callback's > you are casting the widget parent to an Fl_Widget... > > Now, the parent of the button widget is almost certainly the containing > window, not the SetupTest object, so subsequent references to the "this" > will probably be nonsense. > > You need to sort out your widget hierarchy and the parent/child > relationships and then see what does or doesn't work, I think... > Ok thanks, i did not have them both named reset when building, the button was called 'Start' then, i just changed that this morning in the editor only before posting , so sorry for making you work around that, didnt forsee the issue!
I first got the seg fault calling activate() on the input fields directly within the callback for the button., i only added the reset function to try and get around the issue or simply see if any difference. will this seg fault be heirarchy related also do you think ? I think a scope issue certainly but i can't understand why it compiled in that case. (using GCC with all warnings.) the includes are #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Input.H> #include <FL/Fl_Int_Input.H> #include <FL/Fl_Button.H> #include<stdio.h> #include<stdlib.h> _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

