Reactive layer on top of FLTK

39 views
Skip to first unread message

Mo_Al_

unread,
Jun 23, 2024, 5:31:40 PMJun 23
to fltk.general
Hello

I wanted to know your thoughts on reactive gui models.
It seems to be gaining momentum in other programming languages:
- SwiftUI
- Elm and the Elm architecture
- React
- Flutter

These are for the most part declarative and state driven. Users can't usually access widgets and mutate them directly. You modify the state and the view changes accordingly. In a sense they have a functional aspect.

They don't provide the same freedom as with an imperative library and they might incur some overhead due to diffing (comparing views before and after an event) and redrawing. However they help organize code in a cleaner way.
I personally found the MVU (model-view-update, similar to the elm architecture) approach nicer than more traditional MVC or imperative approaches.

I'm experimenting with a library here which provides a reactive layer on top of FLTK:
https://github.com/MoAlyousef/reactif

It requires a C++20 compiler and FLTK 1.4.

Michael

unread,
Jun 24, 2024, 7:05:50 AMJun 24
to fltk.general
First of all, I am only a user of FLTK and not an active developer.
So this is just my personal opinion.
I am somewhat skeptical about the additional reactive layer.

The approach is interesting, but also requires a rethink in development.
The additional layer increases overhead and complexity.

FLTK is small and fast and user-based UI customization can be implemented quickly, but these are the things I like most about FLTK.
The development time can be shortened by using the active layer concept, but is it worth it?
Reply all
Reply to author
Forward
0 new messages