FLTK logo

[fltk.general] Possible bug ? Fl_Browser_ Enter does not invoke callback function

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Possible bug ? Fl_Browser_ Enter does not invoke callback function w1hkj Sep 10, 2020  
 

  // must do shortcuts first or the scrollbar will get them...
  if (event == FL_ENTER || event == FL_LEAVE) return 1;
  if (event == FL_KEYBOARD && type() >= FL_HOLD_BROWSER) {
    void* l1 = selection_;
    void* l = l1; if (!l) l = top_; if (!l) l = item_first();
    if (l) {
      if (type()==FL_HOLD_BROWSER) {
        switch (Fl::event_key()) {
        case FL_Down:
      while ((l = item_next(l))) {
        if (item_height(l)>0) {select_only(l, when()); break;}
      }
      return 1;
        case FL_Up:
          while ((l = item_prev(l))) {
        if (item_height(l)>0) {
          select_only(l, when());
          break; // no need to test wp (return 1)
        }
      }
          return 1;
        }
      } else  {
        switch (Fl::event_key()) {
        case FL_Enter:
        case FL_KP_Enter:
          select_only(l, when() & ~FL_WHEN_ENTER_KEY);
      if (wp.deleted()) return 1;
      if (when() & FL_WHEN_ENTER_KEY) {
        set_changed();
        do_callback();
      }

The line "if (event == FL_ENTER || event == FL_LEAVE) return 1;

prohibits the execution of the later do_callback when FL_WHEN_ENTER_KEY

This prevents using the FL_Enter key in a user callback.

David

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/a98687dc-d139-4bff-e5e6-19e4d17eab59%40bellsouth.net.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.