1. A new GUI/Widget Toolkit?

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.

new topic     » topic index » view message » categorize

2. Re: A new GUI/Widget Toolkit?

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: A new GUI/Widget Toolkit?

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: A new GUI/Widget Toolkit?

Icy_Viking said...

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: A new GUI/Widget Toolkit?

ghaberek said...

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: A new GUI/Widget Toolkit?

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.

new topic     » goto parent     » topic index » view message » categorize

7. Re: A new GUI/Widget Toolkit?

Take a look at https://flutter.dev/multi-platform/desktop

new topic     » goto parent     » topic index » view message » categorize

8. Re: A new GUI/Widget Toolkit?

begin said...

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 )

new topic     » goto parent     » topic index » view message » categorize

9. Re: A new GUI/Widget Toolkit?

Bhupen1277 said...

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

new topic     » goto parent     » topic index » view message » categorize

10. Re: A new GUI/Widget Toolkit?

ghaberek said...

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(!)

new topic     » goto parent     » topic index » view message » categorize

11. Re: A new GUI/Widget Toolkit?

petelomax said...

Thanks, I've corrected the link as well (I left off the https:).

petelomax said...

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

new topic     » goto parent     » topic index » view message » categorize

12. Re: A new GUI/Widget Toolkit?

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.

new topic     » goto parent     » topic index » view message » categorize

13. Re: A new GUI/Widget Toolkit?

ghaberek said...

Some folks recently forked libui into libui-ng

It's "mid-alpha." No way it should be in contention here.

ghaberek said...

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.

new topic     » goto parent     » topic index » view message » categorize

14. Re: A new GUI/Widget Toolkit?

Icy_Viking said...

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!

new topic     » goto parent     » topic index » view message » categorize

15. Re: A new GUI/Widget Toolkit?

ryanj said...
Icy_Viking said...

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/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu