Advantages of different GUI libraries

New to FreeBASIC? Post your questions here.
rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Advantages of different GUI libraries

Postby rnbas » Jul 23, 2019 17:14

I see that there are many libraries for creating GUI in Freebasic:

Code: Select all

'from: https://www.freebasic.net/wiki/wikka.php?wakka=ExtLibTOC

CGUI - Library for making GUIs in a simple way.
Curses - Standardized console user interface library.
GTK+ - Cross-platform Graphical User Interface Library.
IUP - Portable toolkit for building graphical user interfaces.
wxC - Cross-platform Graphical User Interface Library.
Windows API - Windows GUIs and more
X11 - Windowing system commonly used on Linux systems

What are relative advantages and disadvantages of these and which ones do you prefer?
Which one is relatively simple but sufficiently strong to create reasonable GUI applications?
Thanks for your insight.
srvaldez
Posts: 2160
Joined: Sep 25, 2005 21:54

Re: Advantages of different GUI libraries

Postby srvaldez » Jul 23, 2019 17:56

if your platform is Windows and you are not concerned with cross platform, then I recommend WinFBE viewtopic.php?f=8&t=25215
it's like Visual Basic, very intuitive.
Last edited by srvaldez on Jul 23, 2019 18:05, edited 1 time in total.
MrSwiss
Posts: 3307
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Advantages of different GUI libraries

Postby MrSwiss » Jul 23, 2019 17:59

rnbas wrote:What are relative advantages and disadvantages of these and which ones do you prefer?
Which one is relatively simple but sufficiently strong to create reasonable GUI applications?
Such 'open' questions are not really preferred, because it'll require a fully fledged multi-page reply.
It's far better to clearly state 'what' you want it for. (As precise as you can possibly manage.)

Before that, stating 'general requirements' e.g.:
    1) bitness required (32 or 64 or both)
    2) OS's to be supported (which one or list of OS's)
Btw. Curses - Standardized console user interface library. is Console/Terminal only, not GUI.

P.S. check out the "Libraries" Forum Section (many more there).
rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Re: Advantages of different GUI libraries

Postby rnbas » Jul 23, 2019 18:22

To narrow down the question, my requirements are:

1. cross-platform - should work on both Linux and Windows
2. graphical - not curses/text based
3. 64bit is essential; additional 32bit is preferable.
4. Code/script based - not visual GUI creation.
5. Ease of use is very desirable

Similar to what one can do in Python with Tkinter, e.g.:

Code: Select all

 from tkinter import *
 
 window = Tk()
 window.title("Welcome to LikeGeeks app")
 window.geometry('350x200')
 
 lbl = Label(window, text="Hello")
 lbl.grid(column=0, row=0)
 
 btn = Button(window, text="Click Me")
 btn.grid(column=1, row=0)
 
 window.mainloop()


Based on above, what would you recommend?
MrSwiss
Posts: 3307
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Advantages of different GUI libraries

Postby MrSwiss » Jul 23, 2019 18:34

Sorry, I don't speak Python ... :-)

Have a look at: Cairo (or Pango-Cairo) and FLTK (as a first tip, based on Five).
Nevertheless, learning them (and FreeBASIC, naturally) is a must.
You'll find quite a lot of examples, in various parts of the forum, too.

It's finally up to you to decide on "ease of use".
Knatterton
Posts: 165
Joined: Apr 19, 2019 19:03

Re: Advantages of different GUI libraries

Postby Knatterton » Jul 23, 2019 21:13

rnbas wrote:Based on above, what would you recommend?


That's great you exactly know what you want. I have tried most of the mentioned GUI's so i would say from FB viewpoint they all are not completely "developed" with docs and examples in a way you could say it would be easy to start in few hours with modifying a example and you have your program in no time. But it could be that way.

At the moment it all requires much own work.

Short answer: My choice is Fltk-c:

viewtopic.php?f=14&t=24547&hilit=fltk+c&start=270

It is in an advanced state and soon there will be more examples of complete programs.
Last edited by Knatterton on Jul 23, 2019 21:16, edited 1 time in total.
marcov
Posts: 2806
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Advantages of different GUI libraries

Postby marcov » Jul 23, 2019 21:14

I miss QT. Together with Winapi and GTK I'd say those are the major options.
MrSwiss
Posts: 3307
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Advantages of different GUI libraries

Postby MrSwiss » Jul 23, 2019 21:30

Again, not read all posts, because:
marcov wrote:I miss QT. Together with Winapi and GTK I'd say those are the major options.
Since when is WIN-API cross platform (WIN & LIN)? Natively, without WINE, that is.
WQ1980
Posts: 41
Joined: Sep 25, 2015 12:04
Location: Russia

Re: Advantages of different GUI libraries

Postby WQ1980 » Jul 23, 2019 21:43

IUP + CD http://webserver2.tecgraf.puc-rio.br/cd/
cross-platform, 64bit + 32bit, static binding
caseih
Posts: 1397
Joined: Feb 26, 2007 5:32

Re: Advantages of different GUI libraries

Postby caseih » Jul 23, 2019 21:54

MrSwiss wrote:Since when is WIN-API cross platform (WIN & LIN)? Natively, without WINE, that is.
Well technically wine let's you compile win32 C (and C++) source code to native linux binaries using what they call winelib. The result is an elf executable and a few shared libraries. In fact you can even use winelib on native ARM linux distributions.

Having said that, I'm not sure I'd count this as a viable cross-platform GUI toolkit!
rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Re: Advantages of different GUI libraries

Postby rnbas » Jul 24, 2019 1:08

How about FBGUI ? It seems impressive:

https://sourceforge.net/projects/guiwindow9/

viewtopic.php?f=14&t=17058

Is anyone using it regularly?
RNBW
Posts: 192
Joined: Apr 11, 2015 11:06
Location: UK

Re: Advantages of different GUI libraries

Postby RNBW » Jul 24, 2019 15:20

rnbas wrote:How about FBGUI ? It seems impressive:

https://sourceforge.net/projects/guiwindow9/

viewtopic.php?f=14&t=17058

Is anyone using it regularly?


Yes FBGui is impressive. It has lots of examples and a very extensive .chm help file. Unfortunately this is currently in Russian. I am slowly converting to English. However, using Google or Bing translate it is easy to find the appropriate translation into your chosen language.

The library is similar in many ways to Purebasic. Its authors are very helpful . Follow the installation instructions carefully on page 1 of the library and you shouldn't have any problems.

It has become my favourite Freebasic GUI library.
rnbas
Posts: 35
Joined: Jul 22, 2019 18:54

Re: Advantages of different GUI libraries

Postby rnbas » Jul 24, 2019 15:31

Can you please post here the link to installation instructions (I am not able to find on website)
or briefly mention steps here. Thanks.
caseih
Posts: 1397
Joined: Feb 26, 2007 5:32

Re: Advantages of different GUI libraries

Postby caseih » Jul 24, 2019 16:55

rnbas wrote:Can Tk be used from Freebasic?
Yes it could, just as you can use Tk from C. But you'd need to translate the C header files into FB .bi files for the Tcl C API library. Basically you'd be embedding the Tcl interpreter inside your FB program, and then using the C API to interact with it, and to interact with the Tk GUI. Most likely you'd implement the GUI in Tcl code, which your embedded Tcl interpreter would run. At least that's how it worked 20 years ago when I last used Tcl/Tk with a C application. Python supports Tk, but wraps up the Tcl interpreter and the C api glue interface with Python classes. If someone was inclined, they probably could implement something similar for FB.
( Also, is Gtk related to Tk? )
No not at all. GTK used to stand for Gimp Toolkit, as it was used to create the Gimp image editing application. Tk probably stands for "toolkit", but it was created as a graphical UI toolkit for the Tcl language. Usually they refer to it as Tcl/Tk.

Clear as mud?

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 1 guest