On 28.09.2017 07:11, Kolya Kosenko via Boost wrote:
> Hello,
>
> Here is my C++ GUI library based on Boost, it
> - is cross-platform
> - uses native system-provided widgets
what widgets do you consider "system-provided" ? What backends do you
bind to on the different platforms, and can those bindings be changed ?
> - has STL-like and Boost-like API
> - compatible with other Boost libraries
What does that mean ?
> - supports modern C++11/14/17 features
>
> Currently supported modules:
> - Graphics
> - Widgets
> * Command widgets
> * Data input-output widgets
> + Date and time pickers
> + Strings container widgets
> + Text widgets
> * Informational widgets
> + Logging
> * Containers
> + Alerts
> + Notifications
> + Prompts
> - Layouts
> - Events
> - Audio
> - Coordinates
> - Localization
> - Thread support
> - Helpers
>
> Documentation (and "Hello, World!" application source code):
> https://kosenko.github.io/boost.ui/
I'd be interested in some high-level documentation explaining the basic
programming and execution model of the API. For example, how are events
handled and how are they bound to particular actions ? Are programs
inherently multi-threaded or single-threaded (e.g., does the main event
loop run in its own thread) ?
Is your library mostly just a (thin) layer over existing
platform-specific GUI libraries, or does it reimplement a lot of the
logic itself ?
(And what is that cryptic "ui_main()" function ? :-) )
>
> Source code:
> https://github.com/kosenko/ui
>
> Beman's challenge:
> https://github.com/kosenko/ui/blob/master/example/cpp11/beman.cpp
>
> Re-implemented GUI examples from Bjarne Stroustrup's book:
> https://github.com/kosenko/ui/blob/master/example/cpp11/stroustrup.cpp
>
> Other examples:
> https://github.com/kosenko/ui/tree/master/example
>
> What do you think?
>
> Regards,
> Kolya Kosenko.
Thanks,
Stefan
--
...ich hab' noch einen Koffer in Berlin...
> Here is my C++ GUI library based on Boost, it
> - is cross-platform
> - uses native system-provided widgets
> - has STL-like and Boost-like API
> - compatible with other Boost libraries
> - supports modern C++11/14/17 features
> […]
I looked at the code examples, which look neat. I also like the goal to have a cross-platform C++ lib for GUIs, but isn't an UI library too elaborate/invested for Boost? I am quite familiar with Qt and its a huge library, and yet it is moving fast to keep up with new trends. You would need a lot of active and dedicated developers to keep up and provide similar amounts of features.
Some people here probably shiver at the thought how Qt distorted C++ get things done, introducing its own preprocessor and missing language features in a non-standard way. I am not a fan either. And still, Qt is easy to work with and the documentation is outstanding. With KDE it has a large user base, too. It is hard to beat such competition.
Just my 2 cents.
Hans
why not simply use stdC++ (11) for this ?
>> I'd be interested in some high-level documentation explaining the basic
>> programming and execution model of the API.
> You can ask for implementation details here. Documentation explains only API.
Not quite: programming and execution models are hardly implementation
details. They are arguably more important than the API itself, to decide
whether this library is usable for specific applications.
>> For example, how are events
>> handled and how are they bound to particular actions ?
> Library subscribes to event handlers in native toolkit. When user
> press button, native event handler eventually calls Boost.UI event
> handler.
what "subscription" model do you use ? What are the events that I can
subscribe to ? How can I add my own event types & sources, and how do I
register callbacks ? (Again, this is first and foremost a conceptual
question, before being about the specific API.)
>> Are programs
>> inherently multi-threaded or single-threaded (e.g., does the main event
>> loop run in its own thread) ?
> There is main GUI thread and you should call GUI functions from other
> your own threads using boost::ui::call_async() function.
>
> Boost.UI library (like all other C++ GUI libraries) aren't thread safe
> because native toolkits are not thread safe.
Are you saying that to use your library I have to run multiple threads ?
>> Is your library mostly just a (thin) layer over existing
>> platform-specific GUI libraries, or does it reimplement a lot of the
>> logic itself ?
> Boost.UI is a rather thin layer with C++11/Boost support.
>
>> (And what is that cryptic "ui_main()" function ? :-) )
> ui_main() function call required for GUI initialization,
> deinitialization, cleanup. It is required for underlying toolkits.
> Actually you can call some functions directly from main() function,
> but it is at your own risk.
That's all a bit vague. This definitely requires better documentation if
you want to convince others to use your library.
Best,
Stefan
--
...ich hab' noch einen Koffer in Berlin...
Fine. My point is: this needs to be documented.
[...]
>
>> what "subscription" model do you use ?
> Sorry what does it means?
What is the mechanism you use to bind events to callbacks ? Is it
extensible, i.e. does it support adding new event types and event
sources ? Are events consumed by callbacks, or can I bind multiple
callbacks to a single event ? (And if so, is there a well-defined order
by which callbacks are executed ?) Etc., etc., that's all the stuff that
makes up a "subscription model".
>> What are the events that I can
>> subscribe to ?
> Event handler function called with on_*() prefix. Usually it is a class
> member functions. For example boost::ui::button::on_press(fn) calls fn
> when user clicks on button.
OK, so "button click" is an event type. Can I add my own ? And how is
the connection to the handler established ?
>> How can I add my own event types & sources, and how do I
>> register callbacks ? (Again, this is first and foremost a conceptual
>> question, before being about the specific API.)
> Custom event types and sources are not supported. I'm not sure that they
> are a part of GUI or GUI-related, for these you can use Boost.Signals2
> library. Probably you can extend Boost.UI by your own classes in your
> application, but it isn't tested yet.
custom event types and sources may not be GUI related, but they need to
be integrated with the application's main event loop. This kind of
extensibility needs to be designed right into the API.
Thanks,
Stefan
--
...ich hab' noch einen Koffer in Berlin...
(You should consider fixing your mail client. Even in this reply it
isn't clear what's yours and what's Niall's reply...)
Stefan
--
...ich hab' noch einen Koffer in Berlin...
> Hello,
>
> Here is my C++ GUI library based on Boost, it
> - is cross-platform
> - uses native system-provided widgets
> - has STL-like and Boost-like API
> - compatible with other Boost libraries
> - supports modern C++11/14/17 features
>
> [...]
> Documentation (and "Hello, World!" application source code):
> https://kosenko.github.io/boost.ui/
Could you clarify how does this library compares, in the fundamentals
concepts, to the Nana gui library?
http://nanapro.org/en-us/
Or is it following the same principles?
Joël Lamotte
Nana library don't uses native widgets. And it is a huge problem. Users
will not have expected look and feel. Widgets on screenshots are awful.
Even GTK+ and Qt applications under Windows looks much better then Nana
applications.
Also Boost.UI has fluent interfaces for widget initialization, that is
much simpler for developers then Nana library approach. Nana has
unsubstantiate complex API.