1. A new GUI/Widget Toolkit?
- Posted by Icy_Viking Feb 01, 2022
- 1264 views
Hello all,
Does anyone have idea on where to start to make a GUI/Widget toolkit from scratch? I'd like to write it in C, so that I could then make a wrapper for it in Euphoria. I've briefly looked over source code for IUP and FLTK, but it looks it has to be built on top of something. Like the Windows API or Xlib(For Linux/Unix). Something that would have common controls to start, like a window, buttons, menus, menu-items, check-boxes and radio buttons. I've seen some GUIs built on top of SDL, so that could be one way. I of course want it to be cross-platform.
2. Re: A new GUI/Widget Toolkit?
- Posted by ChrisB (moderator) Feb 02, 2022
- 1232 views
Hi Andy
I think that's a bit of a task there. How from 'scratch' do you want it to be. Other GUI toolkits are cross platform, because they are effectively interfaces to the 'baseline' APIs - the windows API or the Xlib API, a call to the theoretical toolkit goes to the relevant API depending on OS etc. So all the hard work is done for you.
A worthy, but difficult, task anyway.
3. Re: A new GUI/Widget Toolkit?
- Posted by ghaberek (admin) Feb 02, 2022
- 1243 views
Some folks recently forked libui into libui-ng so they can continue updating it since the original developer had stalled out. The current build environment (Meson) presents a bit of a challenge but otherwise I still think its a good contender to adopt for Euphoria. I'm monitoring this closely and I'd still like to bundle it with Euphoria 4.2 release. The main benefit of libui over IUP is that it supports OS X. But it is still lacking a lot of "bigger" controls.
Otherwise, wxWidgets is continues to see updates and I've made a few attempts over the past several years to "reboot" the wxEuphoria project but it's huge. Currently I'm using (abusing, really) the namespace system to provide an "OOP-like" class segmentation. It'd probably be a bit easier to integrate when we actually have classes. The great thing about wxWidgets is that it's pretty much a "kitchen sink" of controls and platform support.
-Greg
4. Re: A new GUI/Widget Toolkit?
- Posted by petelomax Feb 02, 2022
- 1211 views
Hello all,
Does anyone have idea on where to start to make a GUI/Widget toolkit from scratch? I'd like to write it in C, so that I could then make a wrapper for it in Euphoria. I've briefly looked over source code for IUP and FLTK, but it looks it has to be built on top of something. Like the Windows API or Xlib(For Linux/Unix). Something that would have common controls to start, like a window, buttons, menus, menu-items, check-boxes and radio buttons. I've seen some GUIs built on top of SDL, so that could be one way. I of course want it to be cross-platform.
What you really need in the first place is a simple canvas occupying a window, on which you can draw decent-quality text (so not SDL!).
Get that working cross-platform before you start adding any bells and whistles. Most toolkits go the wrong way about that, getting it all
really fancy on one platform and then facing a mountain of work and fresh compromises that a breadth-first approach would avoid (or
at least get correct much earlier in the process). "I'll do Linux later" would be a big turn-off for me (ditto "Windows later").
I would urge you to take a look at https://rosettacode.org/wiki/Polynomial_regression#Phix which can be run online here.
Gloss over the fact that it is written in IUP, focus on the fact it is effectively less than 285 lines, and (effectively) written in pure Phix.
There is no need to put C into the mix, imnsho, or at the very least strive for the absolute bare minimum performance-critical parts.
What I'd really be interested in is a toolkit which is fundamentally based on the HTML/JavaScript/CSS box model (with extreme emphasis
on the word model, I'm not suggesting you implement CSS on the desktop!), or at least something that could easily be transpiled to that.
5. Re: A new GUI/Widget Toolkit?
- Posted by Bhupen1277 Feb 02, 2022
- 1195 views
Some folks recently forked libui into libui-ng so they can continue updating it since the original developer had stalled out. The current build environment (Meson) presents a bit of a challenge but otherwise I still think its a good contender to adopt for Euphoria. I'm monitoring this closely and I'd still like to bundle it with Euphoria 4.2 release. The main benefit of libui over IUP is that it supports OS X. But it is still lacking a lot of "bigger" controls.
Otherwise, wxWidgets is continues to see updates and I've made a few attempts over the past several years to "reboot" the wxEuphoria project but it's huge. Currently I'm using (abusing, really) the namespace system to provide an "OOP-like" class segmentation. It'd probably be a bit easier to integrate when we actually have classes. The great thing about wxWidgets is that it's pretty much a "kitchen sink" of controls and platform support.
-Greg
wxWidgets: I don't know why this very good GUI has got frozen. It is about time it was brought to the current level. I don't know abc of writing DLLs, otherwise I would do it.
6. Re: A new GUI/Widget Toolkit?
- Posted by Icy_Viking Feb 02, 2022
- 1173 views
Thanks for all the advice.
I'll look more into this libui-ng. Its caught my interest for now. I did use wxEuphoria back in the day. I wouldn't mind trying to help out to get it going again or get it ready for Eu 4.2.0.
7. Re: A new GUI/Widget Toolkit?
- Posted by begin Feb 04, 2022
- 1123 views
Take a look at https://flutter.dev/multi-platform/desktop
8. Re: A new GUI/Widget Toolkit?
- Posted by Bhupen1277 Feb 04, 2022
- 1112 views
Take a look at https://flutter.dev/multi-platform/desktop
I am vary of new "toys".
We have a well tried and developed wxWidgets than needs bringing up to the current version and there are many experts in this forum good at creating DLLs. I have not seen a single reason why there should not be a current version (except my own that I don't know how to )
9. Re: A new GUI/Widget Toolkit?
- Posted by ghaberek (admin) Feb 04, 2022
- 1094 views
We have a well tried and developed wxWidgets than needs bringing up to the current version and there are many experts in this forum good at creating DLLs. I have not seen a single reason why there should not be a current version (except my own that I don't know how to )
The only issue is really that wxWidgets is huge and a lot of work is required to automate the entire process of wrap/build/test/publish. I've at least laid a new foundation with the latest wxEuphoria project on GitHub.
-Greg
10. Re: A new GUI/Widget Toolkit?
- Posted by petelomax Feb 04, 2022
- 1109 views
The only issue is really that wxWidgets is huge and a lot of work is required to automate the entire process of wrap/build/test/publish. I've at least laid a new foundation with the latest wxEuphoria project on GitHub.
Corrected link: https://github.com/OpenEuphoria/wxEuphoria - in case anyone was thinking of asking that's all completely incompatible with Phix, since it embeds Eu-specifics right inside the dll/so, such as struct s1 and the MAKE_SEQ() macro. Not to worry, libui-ng looks like a better bet to me anyway, should I really need anything else to do(!)
11. Re: A new GUI/Widget Toolkit?
- Posted by ghaberek (admin) Feb 04, 2022
- 1102 views
Corrected link: https://github.com/OpenEuphoria/wxEuphoria -
Thanks, I've corrected the link as well (I left off the https:).
in case anyone was thinking of asking that's all completely incompatible with Phix, since it embeds Eu-specifics right inside the dll/so, such as struct s1 and the MAKE_SEQ() macro. Not to worry, libui-ng looks like a better bet to me anyway, should I really need anything else to do(!)
I'm still reconsidering making wxEuphoria library a plain-C interface, especially if its overall easier to manage. I'm open to input and suggestions on that.
-Greg
12. Re: A new GUI/Widget Toolkit?
- Posted by Icy_Viking Feb 04, 2022
- 1059 views
I'm having trouble getting libui-ng compiled into a DLL. I tried following all the directions, but I just couldn't get it to build. I'll see if there's some other things I can try.
As for the Flutter desktop, it does look nice, but the engine backend is written in CPlusPlus, so its OOPy, and its written for Dart, so there may be some issues when trying to make a wrapper for it.
Something like Flutter Desktop or FLTK or some other GUI written in CPlusPlus and not C may be written when Eu 4.2.0 releases, which should have struct support. It might make wrapping CPlusPlus a tad easier. Though I do like how easy C code is to read and its pretty portable.
A C interface to wxWidgets would be nice too. I saw there was a C port of wxWidgets, but it is old and no longer updated or maintained.
13. Re: A new GUI/Widget Toolkit?
- Posted by euphoric (admin) Feb 04, 2022
- 1079 views
It's "mid-alpha." No way it should be in contention here.
The great thing about wxWidgets is that it's pretty much a "kitchen sink" of controls and platform support.
At this point, it has to be wxWidgets. Win32Lib should also not be in contention except as somebody's hobby project.
14. Re: A new GUI/Widget Toolkit?
- Posted by ryanj Feb 04, 2022
- 1055 views
Hello all,
Does anyone have idea on where to start to make a GUI/Widget toolkit from scratch? I'd like to write it in C, so that I could then make a wrapper for it in Euphoria. I've briefly looked over source code for IUP and FLTK, but it looks it has to be built on top of something. Like the Windows API or Xlib(For Linux/Unix). Something that would have common controls to start, like a window, buttons, menus, menu-items, check-boxes and radio buttons. I've seen some GUIs built on top of SDL, so that could be one way. I of course want it to be cross-platform.
*Cough* Redy *Cough* LOL
But seriously, that's exactly what I did with Redy, except it's pure euphoria. I wrapped all the basic win32 api to create windows, handle events, and draw to bitmaps. Eventually, I added more advanced features like clipboard functions. It took me years, and it's still not finished. But, I learned so much from it. I gained a good understanding of the foundational win32 api. Those concepts can be carried over to linux. I haven't had time to port Redy to linux yet, but I basically understand how it could be done. I also learned a ton about optimization! The first few versions of Redy were horribly slow, but the version that RedyCode is built upon is amazingly fast, except for a few odd things here and there. I also learned a ton about important programming concepts, such as object-oriented and reactive programming. Even though Euphoria doesn't technically have those features, I was able to structure my code in a way that followed those concepts. And I also learned a lot of things that I could have done better, and would like to improve, but it would require a lot of rework.
I would suggest looking up the API documentation for windows and/or linux for creating windows, handling events, and drawing graphics. All the general API stuff. Ignore the controls/widget libraries, just look at the raw graphics stuff, and learn how to handle mouse/keyboard events, and draw/load/save bitmaps in memory, and how to manipulate windows and draw to them. It will take a lot of planning and good structure to define your own widget classes and how they interact with each other, as objects in a tree, with parent/child relationships. It's a lot of work, but it's definitely doable and is a great learning experience!
15. Re: A new GUI/Widget Toolkit?
- Posted by Icy_Viking Feb 04, 2022
- 1072 views
- Last edited Feb 06, 2022
Hello all,
Does anyone have idea on where to start to make a GUI/Widget toolkit from scratch? I'd like to write it in C, so that I could then make a wrapper for it in Euphoria. I've briefly looked over source code for IUP and FLTK, but it looks it has to be built on top of something. Like the Windows API or Xlib(For Linux/Unix). Something that would have common controls to start, like a window, buttons, menus, menu-items, check-boxes and radio buttons. I've seen some GUIs built on top of SDL, so that could be one way. I of course want it to be cross-platform.
*Cough* Redy *Cough* LOL
But seriously, that's exactly what I did with Redy, except it's pure euphoria. I wrapped all the basic win32 api to create windows, handle events, and draw to bitmaps. Eventually, I added more advanced features like clipboard functions. It took me years, and it's still not finished. But, I learned so much from it. I gained a good understanding of the foundational win32 api. Those concepts can be carried over to linux. I haven't had time to port Redy to linux yet, but I basically understand how it could be done. I also learned a ton about optimization! The first few versions of Redy were horribly slow, but the version that RedyCode is built upon is amazingly fast, except for a few odd things here and there. I also learned a ton about important programming concepts, such as object-oriented and reactive programming. Even though Euphoria doesn't technically have those features, I was able to structure my code in a way that followed those concepts. And I also learned a lot of things that I could have done better, and would like to improve, but it would require a lot of rework.
I would suggest looking up the API documentation for windows and/or linux for creating windows, handling events, and drawing graphics. All the general API stuff. Ignore the controls/widget libraries, just look at the raw graphics stuff, and learn how to handle mouse/keyboard events, and draw/load/save bitmaps in memory, and how to manipulate windows and draw to them. It will take a lot of planning and good structure to define your own widget classes and how they interact with each other, as objects in a tree, with parent/child relationships. It's a lot of work, but it's definitely doable and is a great learning experience!
Yes Redy is something to look at. My original idea was to build a GUI/low-levelish graphics API in pure C and then make a wrapper for it in Euphoria. Redy is pure Euphoria, but I'd want to start with C, since it would be more portable. The Win32 API is huge. Even Xlib/XCB for Unix/Linux systems is fairly big to. I think SDL and SFML draw upon DirectX and Xlib for whichever OS is the host OS. I could be wrong, I'm just guessing off the top of my head.
EDIT: I found something called MicroWindows. However it looks like it would be a little troublesome to get built under Windows, which is my primary development platform. http://www.microwindows.org/