FLTK logo

Re: [fltk/fltk] Fl::focus(Fl_Widget*) should be independent of Fl_Widget::visible_focus() (Issue #366)

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.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Fl::focus(Fl_Widget*) should be independent of Fl_Widget::visible_focus() (Issue #366) Albrecht Schlosser Jan 12, 2022  
 

Do we need something that prevents focus being transmitted to a widget, knowing that
the widget's handle method returning 0 to the FL_FOCUS event does that already ?

@ManoloFLTK Here's another aspect: the following minimal patch makes the sudoku test program skip readonly cells when the user presses TAB or an arrow key.

diff --git a/test/sudoku.cxx b/test/sudoku.cxx
index 28437fbd8..3edac113d 100644
--- a/test/sudoku.cxx
+++ b/test/sudoku.cxx
@@ -142,7 +142,7 @@ class SudokuCell : public Fl_Widget {
                 SudokuCell(int X, int Y, int W, int H);
   void          draw();
   int           handle(int event);
-  void          readonly(bool r) { readonly_ = r; redraw(); }
+  void          readonly(bool r) { readonly_ = r; redraw(); visible_focus(!r); }
   bool          readonly() const { return readonly_; }
   void          test_value(int v, int n) { test_value_[n] = v; redraw(); }
   int           test_value(int n) const { return test_value_[n]; }


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/366/1011460484@github.com>

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'.