>
> Here's what I *think* you meant.
> This appears to work just fine (though I suspect I would have approached
> this differently, this seems to be doing what you intended...!)
>
>
> /*********************************************************
>
> fltk-config --compile test.cxx
>
> *********************************************************/
> #include <stdlib.h>
> #include <stdio.h>
>
> #include <FL/Fl.H>
> #include <FL/Fl_Window.H>
> #include <FL/Fl_Button.H>
> #include <FL/Fl_Int_Input.H>
>
> class SetupTest : public Fl_Window
> {
> public:
> Fl_Button *Reset;
> Fl_Int_Input *inputA;
> Fl_Int_Input *inputB;
>
> bool state;
> int valCount;
> void InputCb_i(Fl_Widget* wgt, void* v);
> static void InputCb(Fl_Widget* wgt, void* v);
>
> void Reset_CB_i(Fl_Widget* wgt, void* v);
> static void Reset_CB(Fl_Widget* wgt, void* v);
>
> void reset_fn();
>
> SetupTest(int X, int Y, int W, int H);
> };
>
> SetupTest::SetupTest(int X, int Y, int W, int H) : Fl_Window(X, Y, W, H)
> {
> this->begin();
> Reset =3D new Fl_Button(226, 20, 64, 20, "Reset");
>
> inputA =3D new Fl_Int_Input(215, 50, 20, 24, "InputA");
> inputA->tooltip("enter number A");
> inputA->type(2);
> inputA->when(FL_WHEN_RELEASE);
>
> inputB =3D new Fl_Int_Input(215, 80, 20, 24, "InputB");
> inputB->tooltip("enter number B");
> inputB->type(2);
> inputB->when(FL_WHEN_RELEASE);
>
> this->end();
>
> valCount =3D 0;
> state =3D false;
>
> inputA->callback((Fl_Callback*) InputCb);
> inputB->callback((Fl_Callback*) InputCb);
>
> Reset->callback((Fl_Callback*) Reset_CB);
>
> show ();
> }
>
> void SetupTest::InputCb_i(Fl_Widget* w, void* v)
> {
> Fl_Int_Input* inp =3D (Fl_Int_Input*) w;
> char* p;
> long int longI =3D 0;
>
> if (inp->changed())
> {
> inp->clear_changed();
> longI =3D strtol(inp->value(), &p, 10);
> printf("%s '%s'\n", inp->label(), inp->value());
>
> printf("%ld\n", longI); fflush(stdout);
> inp->deactivate();
> valCount++;
> }
>
> if(valCount > 1)
> {
> printf("READY : %d\n", valCount); fflush(stdout);
> valCount =3D 0;
> state =3D true;
> }
>
> }
>
> void SetupTest::InputCb(Fl_Widget* wgt, void* v)
> {
> SetupTest *st =3D (SetupTest*)wgt->parent();
> st->InputCb_i(wgt, v);
> }
>
> void SetupTest::Reset_CB_i(Fl_Widget* w, void* v)
> {
> Fl_Button* button =3D (Fl_Button*)w;
> if(state)
> {
> reset_fn();
> state =3D false;
> }
> }
>
> void SetupTest::Reset_CB(Fl_Widget* wgt, void* v)
> {
> SetupTest *st =3D (SetupTest*)wgt->parent();
> st->Reset_CB_i(wgt, v);
> }
>
> void SetupTest::reset_fn()
> {
> inputB->activate();
> inputA->activate();
> }
>
> int main (int argc, char ** argv)
> {
> SetupTest testObj(100, 100, 300, 200);
>
> return Fl::run();
> }
>
> /* End of file */
>
Hey thanks for the example, that 3D thing still needs to be looked at by me
though, but i will get a good picture of the compsition from that, thanks,
i keep thinking the 3D thing is a character that keeps coming up as a mistake
by the browser showing the text, i know you explained the bitwise operators
previously but i cant get any google hits for |=3D and c programming
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk