1. libui: a portable GUI library for C

I recently came across libui and started putting together a wrapper for it. It's still in early alpha stage, but it's been under continuous development for about the past year. I've already had some interaction with the developer on GitHub and I've even got my wrapper listed on the main page for the project.

The API reminds me of IUP but it's not as overwhelming and it relies entirely on box sizer concepts like wxWidgets. The API will surely grow over time and I hope to keep up on the changes. The developer has been quite good about making small consumable commits and tracking changes on the main project page.

You'll find my wrapper here: https://github.com/ghaberek/libui-euphoria. There are precompiled binaries on the project releases page.

Note: The latest Windows binaries don't seem to be working correctly right now (see #111) but I can provide a zip of my local build from Visual Studio upon request.

Here is the requisite "hello world" example. More examples can be found here: examples.

include libui/ui.e 
 
atom mainwin 
 
function onClosing( atom w, atom data ) 
 
    uiControlDestroy( w ) 
    uiQuit() 
 
    return 0 
end function 
 
function shouldQuit( atom data ) 
 
    uiControlDestroy( mainwin ) 
 
    return 1 
end function 
 
procedure main() 
 
    object err 
    atom menu 
    atom item 
    atom box 
    atom _label 
 
    err = uiInit() 
    if sequence( err ) then 
        puts( 2, err ) 
        abort( 1 ) 
    end if 
 
    menu = uiNewMenu( "File" ) 
    item = uiMenuAppendItem( menu, "Item" ) 
    item = uiMenuAppendQuitItem( menu ) 
    uiOnShouldQuit( "shouldQuit" ) 
 
    mainwin = uiNewWindow( "Window", 640, 480, 1 ) 
    uiWindowSetMargined( mainwin, 1 ) 
    uiWindowOnClosing( mainwin, "onClosing" ) 
 
    box = uiNewVerticalBox() 
    uiBoxSetPadded( box, 1 ) 
    uiWindowSetChild( mainwin, box ) 
 
    _label = uiNewLabel( "Hello, World!" ) 
    uiBoxAppend( box, _label, 0 ) 
 
    uiControlShow( mainwin ) 
    uiMain() 
    uiUninit() 
 
end procedure 
 
main() 

-Greg

new topic     » topic index » view message » categorize

2. Re: libui: a portable GUI library for C

I looked over the wrapper and I looked over the actualu UI program. I have to say, that I see a lot of potential in it. I hope the program expands upon and that the wrapper will grow as the library grows. Kudos, keep up the good work.

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

3. Re: libui: a portable GUI library for C

Hi

ghaberek said...

I recently came across libui and started putting together a wrapper for it. It's still in early alpha stage, but it's been under continuous development for about the past year. I've already had some interaction with the developer on GitHub and I've even got my wrapper listed on the main page for the project.

The API reminds me of IUP but it's not as overwhelming and it relies entirely on box sizer concepts like wxWidgets. The API will surely grow over time and I hope to keep up on the changes. The developer has been quite good about making small consumable commits and tracking changes on the main project page.

You'll find my wrapper here: https://github.com/ghaberek/libui-euphoria. There are precompiled binaries on the project releases page.

Note: The latest Windows binaries don't seem to be working correctly right now (see #111) but I can provide a zip of my local build from Visual Studio upon request.

Here is the requisite "hello world" example. More examples can be found here: examples.

-Greg

Hallo, looks really nice....

But what about this: https://bitbucket.org/ghaberek/iup4eu

and all this talking: http://openeuphoria.org/forum/129148.wc

Just for the files, iup4eu is dead?

Andreas

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

4. Re: libui: a portable GUI library for C

For Euphoria there are now three IUP wrappers:

  • euIUP (original no longer developed but still works)
  • iup4eu ( complete and working )
  • EuIup (recent, compact version and working )

You can also add Phix which has an Iup wrapper.

The documentation that comes with IUP applies to all of the wrappers.

Therefore, IUP with Euphoria is working and usable.

To make IUP better some improved documentation would be needed. For this I am sorry, but I am still working on this.

I believe that IUP with Euphoria has a strong place as a multi-platform gui. A multi-platform gui is the most convenient as a starting point when presenting Euphoria to new programmers.

But, is a multi-platform gui the answer to what users actually want? I am beginning to suspect that a native gui for each operating system is what users really want because there are no extra libraries that must be installed.

Now libui makes things more interesting. A clean, fresh, and portable gui could be the better solution.

_tom

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

5. Re: libui: a portable GUI library for C

_tom said...

But, is a multi-platform gui the answer to what users actually want? I am beginning to suspect that a native gui for each operating system is what users really want because there are no extra libraries that must be installed.

Now libui makes things more interesting. A clean, fresh, and portable gui could be the better solution.

_tom

But Iup do exatly the same thing as libui, a common api for diferent native toolkits.
I believe Iup goes beyound by exposing canvas, opengl and an imaging lib.

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

6. Re: libui: a portable GUI library for C

Dear _tom,

thank you

your posting exactly describes why Euphoria will be a hobby language forever.

No problem, i like it this way. But:

Consider you have a customer (only one, not one hundred).
You write program and you have to support this program for about 2-3 years! Nothing special, just a bread and butter job.

What your customer basiclly wants:
doumentation, source code (maybe} and a stable plattform (maybe he wants to hire a new programer later).

What do yo have to offer? euIUP allready unsupported,iup4eu pre-release BETA state (not my words),EuIup completly untested.

Euphoria 4.0.5 not updated since 2012.

And for sure now, libui, completely unstable fresh and cool.

That's a base that is really hard to sell!

Hope you understand my words

Andreas

_tom said...

For Euphoria there are now three IUP wrappers:

  • euIUP (original no longer developed but still works)
  • iup4eu ( complete and working )
  • EuIup (recent, compact version and working )

You can also add Phix which has an Iup wrapper.

The documentation that comes with IUP applies to all of the wrappers.

Therefore, IUP with Euphoria is working and usable.

To make IUP better some improved documentation would be needed. For this I am sorry, but I am still working on this.

I believe that IUP with Euphoria has a strong place as a multi-platform gui. A multi-platform gui is the most convenient as a starting point when presenting Euphoria to new programmers.

But, is a multi-platform gui the answer to what users actually want? I am beginning to suspect that a native gui for each operating system is what users really want because there are no extra libraries that must be installed.

Now libui makes things more interesting. A clean, fresh, and portable gui could be the better solution.

_tom

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

7. Re: libui: a portable GUI library for C

andi49 said...

Hi

Hallo, looks really nice....

But what about this: https://bitbucket.org/ghaberek/iup4eu

and all this talking: http://openeuphoria.org/forum/129148.wc

Just for the files, iup4eu is dead?

Andreas

My work on libui does not invalidate my work on IUP. They're two quite different projects. But I'm very curious about where libui might be going so I'm trying to keep up with it as it's developed.

IUP is huge and, to be honest, quite difficult to maintain on my own. It's why I tried my hand and wrapping automatically, but that has its limits. As Tom said, documentation is key but I'd like to get that integrated with wrapper code so that it can be generated with eudoc.

It's also been difficult to make it easier for users to install IUP on their own. The folks at Tecgraf don't even provide an automated installer or deb/yum packages. I have a half-working Inno Setup project for automatically downloading and installing IUP on Windows, but that's just for Windows.

I don't really want to be maintaining so many different aspects of IUP on my own. I've asked for help on the project, and I've gotten some but the project still needs more help. I don't know how much effort I can put into it without others stepping up to help.

Plus, with the recent addition of EuIup, I feel like we're starting to have too many cooks in the kitchen. I appreciate the efforts there but why not help with iup4eu instead? The great thing about standards is that everybody has one and that's really discouraging when one is trying to improve the state of things.

-Greg

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

8. Re: libui: a portable GUI library for C

ghaberek said...

My work on libui does not invalidate my work on IUP. They're two quite different projects. But I'm very curious about where libui might be going so I'm trying to keep up with it as it's developed.

Glad to hear that.

ghaberek said...

Plus, with the recent addition of EuIup, I feel like we're starting to have too many cooks in the kitchen.

I just tried that, and have to say I was not impressed with that either. First thing I noticed is that IupSetAttributes does not even work!
It is a bit of a shame that the Phix wrapper deserves to be quite different internally (mainly no allocate_string calls), but no-one ever said life was fair.

ghaberek said...

I appreciate the efforts there but ... really discouraging when one is trying to improve the state of things.

You think you've got problems? Try being the sole person responsible for the entire language infrastructure underneath your IUP wrapper as well! blink

On the documentation side, if there is by any slim chance anything I've written that may be useful, feel free to nick it. (Grab a copy of Phix.chm and see Other Libraries/pGUI.)

Pete

PS: Oh, I forgot to say: am having a go at porting Edita to IUP - the new GUI is fine, and I've blagged a fair few half-decent-sized blocks of gui independant stuff, but as was always expected, extricating some of that decade-old logic from its win32-only gui was never going to be particularly easy, and there is plenty of it.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu