Giter Site home page Giter Site logo

Comments (8)

Albrecht-S avatar Albrecht-S commented on June 27, 2024

Thanks for the heads-up.

This is true, however it would need an API change which we try to avoid as much as possible.

One possible solution: deprecate Fl_Input_::position() and add a new method, for instance Fl_Input::insert_position() to replace it (all three overloaded methods). Then we could remove Fl_Input_::position() in a later FLTK version, presumably 1.5 (or higher).

from fltk.

pwiecz avatar pwiecz commented on June 27, 2024

Oh, I thought that 1.4 is not considered stable, so API changes are still possible.
But I understand, that API is already stabilised.

from fltk.

Albrecht-S avatar Albrecht-S commented on June 27, 2024

Thanks for your feedback. To explain: we try to keep the API (Application Programming Interface) across all versions so developers don't need to change their program code from one FLTK version to another. You could still compile most of FLTK 1.1 code with 1.3 (with a few minor exceptions) and so you will with 1.4.

The ABI (Application Binary Interface) however is not yet final for 1.4, it can still be modified until 1.4.0 gets released, but must be constant during 1.4.x releases.

from fltk.

Albrecht-S avatar Albrecht-S commented on June 27, 2024

FTR: I noticed that Fl_Text_Display and Fl_Text_Editor (by inheritance) already have an insert_position() method. This needs to be checked and can be either

  1. good, if arguments and semantics are the same (compatible)
  2. bad, if not. Then we'd need another name.

This is just a reminder - code not yet checked.

from fltk.

Albrecht-S avatar Albrecht-S commented on June 27, 2024

Note: we have more than only the methods mentioned above shadowing Fl_Widget::position(). This is what I found (may not be complete):

int Fl_Browser_::position() const { return position_; }
void Fl_Browser_::position(int pos);

void Fl_Help_Dialog::position(int xx, int yy);

int Fl_Input_::position() const {return position_;}
int Fl_Input_::position(int p, int m);
int Fl_Input_::position(int p) {return position(p, p);}

int Fl_Text_Selection::position(int *startpos, int *endpos) const;

void Fl_Tile::position(int oldx, int oldy, int newx, int newy);

void Fl_Widget::position(int X, int Y) {resize(X, Y, w_, h_);}

I wonder if it's worth the effort to change any of these methods, particularly since we need to keep the API for backwards compatibility anyway, at least for some (indefinite) time and you can always use Fl_Widget::position(X, Y) explicitly.

Just thinking aloud: maybe we could add another method like Fl_Widget::set_position(int X, int Y) so users can use this instead (w/o a name conflict).

from fltk.

MatthiasWM avatar MatthiasWM commented on June 27, 2024

PR is in #666

  • Fl_Browser_::position -> Fl_Browser_::vposition (mirrors Fl_Browser_::hposition)
  • Fl_Input_::position -> Fl_Input_::insert_position (mirrors Fl_Text_Input)
  • Fl_Text_Selection::position -> Fl_Text_Selection:: selected()
  • Fl_Help_Dialog::position is ok, as it repositions the window
  • Fl_Tile::position -> Fl_Tile:: move_intersection (was: adjust)
  • update all includes tests

from fltk.

Albrecht-S avatar Albrecht-S commented on June 27, 2024

Fl_Tile::position -> Fl_Tile::adjust

Just for the record: isn't this Fl_Tile::move_intersection() in #666 ?

from fltk.

MatthiasWM avatar MatthiasWM commented on June 27, 2024

Yep, I changed my mind when implementing it. Fixed.

from fltk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.