Rafal wrote:
> Hi, after using FLTK2 for some time, I have following ideas how to overall
> improve it;
>
> General directions, imho could be:
> 1) nicer modern C++
> 2) better examples
> 3) better layout mechanizms?
> 4) better OS and misc functions
> 5) stronger development team and QA
>
> In detail:
>
> 1) For example using const char* and assuming its from text literal (need to
> use copy_label). This is not very nice.
> Instead I would prefer to just have a label(std::string)
> I guess it can be trivially added by overloading like
> foo::label(const std::string &txt) { copy_label(txt.c_str(); }
> etc.
>
>
I agree. Label(const std::string& str) should copy by default and the
user should have LabelRef(std::string& str) to reference the label if
they want that behavior. But I don't understand why I have to use
copy_label(const char*) explicitly or provide my own container to hold a
label allocation - that really belongs in its own class (i.e. coupling).
> Another thing are void* data.
> I would like instead to have a genera class like
> class user_data { public: };
> and then users would inherit from it.
>
Or make use of the boost::signals library, which uses signals and slots
to handle callbacks.
Making use of both STL and Boost will NOT necessarily bloat the code (if
used properly), but will definitely make the code less buggy and more
readable. There are several places in the 1.1.x series that could
benefit tremendously just from boost::shared_ptr and
std::vector<whatever>. Boost and STL are not going away, and should be
(I could be wrong here as I am not a big windows fan) platform independent.
Ryan
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev