HI Greg,

            I implemented as you said. It worked great. But the problem is
callback is not happening. Here is the code. Can u plz tell me why it is
not happening??


class colorInpt : public Input {
  int handle(int event);
  public:
  colorInpt(int x, int y, int w, int h, const char *L);

};

colorInpt::colorInpt(int x, int y, int w, int h, const char *L) : Input(x,
y, w,h,L){ //Constructor for Input class
}

int colorInpt::handle(int e) {
  int ret = 0;
  switch (e) {
    case   FOCUS: color(0xff0c3800);
                  redraw();
                  return False;
    case UNFOCUS: color(0xa3a3c600);
                  redraw();
                  return False;
  }
  return(ret);
}

static colorInpt *inputL = NULL;

static void cb_mycallback(colorInpt* ip, void*){

  strcpy(LoginId, ip->value());
#ifdef DEBUG
  fprintf(stderr,"Login Id ::%s\n", LoginId);
#endif
}


 inputL = new colorInpt(100, 50, 130, 25, "Login Id    :");
      inputL->labelsize(14);
inputL->callback((fltk::Callback*)cb_mycallback);
      inputL->when(fltk::WHEN_CHANGED);


On Thu, Apr 12, 2012 at 9:36 AM, Rajesh Kumar <[email protected]> wrote:

> Hi Greg,
>
>            Here I should declare a class named Fl_Input or can I directly
> call handle method of Input box???
>
> On Wed, Apr 11, 2012 at 11:35 PM, Greg Ercolano <[email protected]> wrote:
>
>> On 04/11/12 10:46, Rajesh Kumar wrote:
>> >    Thanks for the reply. Can u post pseudo code for this??
>>
>>    I think Albrecht means something like this in your derived class:
>>
>>    int handle(int e) {
>>        int ret = Fl_Input::handle(e);
>>        switch (e) {
>>            case   FL_FOCUS: color(YOUR_FOCUS_COLOR);   redraw();
>> return(1);
>>            case FL_UNFOCUS: color(YOUR_UNFOCUS_COLOR); redraw();
>> return(1);
>>        }
>>        return(ret);
>>     }
>> _______________________________________________
>> fltk mailing list
>> [email protected]
>> http://lists.easysw.com/mailman/listinfo/fltk
>>
>
>
>
> --
> *
> Thanks & Regards,
> Rajesh Kumar P
> *
>
>


-- 
*
Thanks & Regards,
Rajesh Kumar P
*
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to