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) ManoloFLTK Jan 12, 2022  
 

I confess I'm lost about what's the purpose of Fl_Widget::visible_focus(int) .

  1. Its name suggests it's related to the widget being drawn with a dotted line when it's focused.
    That's indeed the case if you apply ->visible_focus(0) to a Fl_Toggle_Button widget for example :
    with this, the dotted line disappears when the button gets redrawn atfer having been pressed.

  2. Its documentation mentions something entirely different, that this function modifies the keyboard focus navigation.

  3. Its effect mixes both aspects, as seen modifying test/input.cxx with
    b->visible_focus(0);
    added after
    b = new Fl_Toggle_Button(10,y,200,25,"FL_WHEN_CHANGED"); (line # 120)

  • Run first the unmodified input prog, put focus to the top text field, click mouse on "FL_WHEN_CHANGED": the button contains the dotted line, and the top text field has lost focus;
  • Run the modified input prog, put focus and click mouse as above : the clicked button has no dotted line but the focus stays in the top text field which receives text that you may type-in then. Clearly, the focus stays unchanged because of the test done inside Fl::focus(Fl_Widget*) being discussed here.

Do we want Fl_Widget::visible_focus(int) to have both these effects?

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 ?


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/1011115421@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'.