Linux GUI solution (FLTK vs. GTK)

Archives Forums/Linux Discussion/Linux GUI solution (FLTK vs. GTK)

Robert(Posted 2005) [#1]
skidracer recently mentioned that FLTK was the Linux GUI solution. I'm not so sure that this is a good idea, as FLTK isn't exactly very pretty, and it doesn't tie in well with the rest of the system.

Given that the free GTK toolkit used by many Linux applications comes under the LGPL license (so it can be used in commercial applications), is installed on most Linux machines by default, and can be skinned to match QT (KDE) apps, why not use that instead?

EDIT: As an alternative, would it be possible for the GUI module to be designed so that different toolkits could be used if the programmer decided (ie. in the same way that the Max2D module could use a different graphics API by replacing the BRL.glMax2D module with a different one - eg one which used software rendering)


Mark Tiffany(Posted 2005) [#2]
I would certainly expect the GUI module to be abstracted sufficently well to allow you to use a GTK / FLTK / wxWidgets / Windows native API / whatever GUI systems under the hood that you like. As you say - that's how the Max2d module works - and it's perfectly possible to have a BRL.dx7Max2D module instead of the gl one.


marksibly(Posted 2005) [#3]
Hi,

We did have a play with GTK, but it is a huge beast and its design made it difficult to integrate with it.

Which is not to say it can't be done, more really that we just lacked the necessary experience at the time. Remember, BlitzMax is also our first Linux (and Mac) project, and lots of time has gone into purely learning the platform.

The appeal of FLTK is simply that it is very lightweight and very easy to work with. It is also very 'pure' in a cross-platform sense as it does its own drawing. I agree that it's not the prettiest, but I believe its possible to override the drawing code so it should be possible to sex it up a bit. Although I doubt it'll ever end up with the native feel of GTK.

As for a common interface for *all* GUIs, I'm not convinced this is a good idea. To encapsulate all the stuff that GTK can do would take a massive interface which may be very hard to implement on other GUI systems.

I personally think it would be best to treat GTK as its own thing, and give it as GTK-like an interface as possible. Sure, once you'd gone GTK there'd be no going back, but you'd have one hell of a GUI module available to you so why would you want to?!?


Robert(Posted 2005) [#4]
The reason I suggest a common interface for at least the basics in all GUIs is so that code can be truly cross-platform. I realise that GTK for example will have a lot of features specific to it, in which case the program could cast the GUI driver object to a GTK driver object to access the specialised functions.


Mark Tiffany(Posted 2005) [#5]
I expect a 'base' interface could be generic across all modules, allowing the core elements of a GUI module to be GUI library independent. But I suspect this would be very limited (i.e. basic windows, buttons, canvases), and that if you want to make the most of a given GUI library or OS GUI, the library will have functions dedicated to it. And in most cases, it's the more feature rich module that people will want to use...


JaviCervera(Posted 2005) [#6]
Why not make a wxWidgets module? It is a cross-platform common interface for WinAPI, GTK+, Cocoa, and others.


Beaker(Posted 2005) [#7]
I would prefer wxWidgets as well.


Mark Tiffany(Posted 2005) [#8]
The brief look at wxWidgets that I had suggested it looked like a good candidate - and I have suggested it to mark before...


Robert(Posted 2005) [#9]
wxWidgets does look promising - it is LGPL so it would be "license-safe" for all 'Max users.


FlameDuck(Posted 2005) [#10]
Consider this another vote for wxWidgets.


Difference(Posted 2005) [#11]
I agree that wxWidgets looks less ugly than FLTK , but it does not look look like it's skinnable or do mouseover effects.
Pretty basic requirements for 2005, and especially for a game programming language.

Also check out http://www.wxwidgets.org/whychoos.htm :

OpenGL integration
A wxGLCanvas package is available to allow wxWidgets applications (currently GTK and Windows only) to support OpenGL. Very few changes need to be made to existing OpenGL applications.


I think a common BlitzMax GUI lib should support OpenGL apps on all three platforms. Fullscreen too! :)


flying willy(Posted 2005) [#12]
more importantly does it look like the host os gui scheme?


marksibly(Posted 2005) [#13]
D'oh!

I actually meant wxWidgets, not GTK!


LarsG(Posted 2005) [#14]
That's what beers do to you Mark!! ;)
(j/k.. hehe.. it's all good)

*edit* too many beers for me makes me post stupid stuff like this too :p *edit*


Rook Zimbabwe(Posted 2005) [#15]
KDE, Gnome... Both of those seem to have the ability to run each others programs... I use Gnome in Redhat. KDE with TinyLinux. I need to research wxWidgets more...

-RZ