DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2729
Version: 1.3-current


Okay, I tested with and w/o the patch with the new attached spinner2.cxx
that has another button (label NOP) just to receive input focus when
pressing the TAB key, or to click on it to move the input focus from the
spinner input field to another widget.

(1) TAB works as expected and triggers the callback w/o the patch, as well
as clicking on the button (FL_WHEN_RELEASE works as expected).

(2) *With* the patch, each key press in the input field triggers the
callback (as expected with FL_WHEN_CHANGED), but this is /not/ the
*intended* behavior of this widget.

Thus, this STR should be closed "w/o resolution".

To Richard: if you /really/ need the behavior as changed by your patch,
then you should write your own widget, since we can't change it as
suggested in your patch. But maybe this was only a misunderstanding?

Note that my test was on Windows, maybe you see different behavior on
another platform? Please comment on this, otherwise this STR will be
closed w/o resolution in a few days.


Link: http://www.fltk.org/str.php?L2729
Version: 1.3-current
// file: spinner.cxx
// use: "fltk-config --compile spinner.cxx" to compile
#include <FL/Fl_Window.H>
#include <FL/Fl_Spinner.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>
#include <FL/Fl.H>
#include <stdio.h>

void spinner_cb(Fl_Widget *w, void *v) {
  Fl_Spinner *s = (Fl_Spinner *)w;
  Fl_Box *message = (Fl_Box *)v;
  int val = (int)s->value();
  static char buf[100];
  sprintf(buf,"received callback: value = %d",val);
  message->label(buf);
  message->redraw();
  printf("%s\n",buf); fflush(stdout);
}

int main (int argc, char **argv) {
  Fl_Window *win1 = new Fl_Window(250,150);
  Fl_Spinner *spinner = new Fl_Spinner(50,10,100,80);
  Fl_Box *message = new Fl_Box(10,110,230,30);
  Fl_Button *b = new Fl_Button(180,10,40,40,"NOP");
  message->label("callbacks will show up here ...");
  win1->end();
  spinner->callback(spinner_cb,message);
  win1->show(argc,argv);
  return Fl::run();
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to