You are not logged in.

#1 2008-09-03 14:02:44

joltgen
Member
Registered: 2008-08-05
Posts: 14

C++ && Gui

Hi, I'm planning to create a gui to a C++ application I am to write as a school project. The application will be a XML search engine of sorts. The gui will be quite "simple" and I'd love to get some tips on which libraries I should use for the graphical components (GNU/Linux ofc)?


"Freedom is not 'choosing between black and white,but to avoid such predetermined choice."

Offline

#2 2008-09-03 19:11:11

kamituel
Member
From: Poland
Registered: 2006-09-14
Posts: 47
Website

Re: C++ && Gui

On Linux I've been using only GTK+ (for C++ - Gtkmm) and Qt (of course also in C++).
Qt seems to be more polished, and using it was quite easy and fun. Also QtDesigner is a more intuitive than Glade.

But I wrote my last project in GTK, because of Qt's license (it was proprietary app), and I was suprised how easy and
really nice it was. My first Gtkmm app was quite simple, but it was painful to write using Gtkmm. But now, for the second time, I liked it even more than Qt.
I'm not sure why... Probably it is a little bit less intuitive for the begginer that Qt, but at the second glance it is really though-through and nice.

So, I reccomend you to choose any one of those toolkits for this app, and for your next try to use another one. It's always good to check what would you like the best. Even in small apps you should feel the difference.

Ah, and the last thing - I have impression that apps wrote in Qt are more responsive than GTK ones. I mean, on example, in Notebook it takes less time to switch between tabs etc.


I tried, I failed, no matter. Try again, fail again, fail better.

Offline

#3 2008-09-03 19:15:35

X/ax
Member
From: Oost vlaanderen, Belgium
Registered: 2008-01-13
Posts: 275
Website

Re: C++ && Gui

I think when you mention linux + gui the way to go easily is to use glade, and dynamically load the design.
That way, you simply keep the form design and the code seperated.

However, glade is indeed not that quite intuitive, and it can be a pain in the ass sinceit's not even near IDE-like...
You have to use multiple apps to write the total program.


My coding blog (or an attempt at it)
Archer start page (or an attempt at it)

Offline

#4 2008-09-03 23:13:38

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: C++ && Gui

There's really a point to note here: beginners often see Glade for Gtk+ and think it's a full IDE like NetBeans or VisualStudio or Delphi or whatever... But it's not. Gtk+ apps, differently from Qt (and many other languages/toolkits), can load interfaces from external XML specifications, instead of constructing widgets with procedural language as actual code. So, Glade is used only to create those XML specifications for the interface in a visual way - all the actual functionality and event handling will be done inside your code. That way, Glade doesn't restrict you for only one language, as the XML can be loaded with gladexml in any language that contains bindings for Gtk (C, C++ with gtkmm, C#, Java, Python, Ruby... maybe some more).

Offline

#5 2008-09-04 08:46:48

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: C++ && Gui

If you want a way to write interfaces for Windows and Linux very easily, then have a look at ultimate++. I was impressed by the way the GUI code is designed, it's very short, functional and still readable.

Offline

#6 2008-09-04 09:30:05

krims0n
Member
Registered: 2008-08-25
Posts: 17

Re: C++ && Gui

Offline

#7 2008-09-04 13:36:07

Adams
Member
From: Poland
Registered: 2007-02-12
Posts: 14

Re: C++ && Gui

freakcode wrote:

[...]But it's not. Gtk+ apps, differently from Qt (and many other languages/toolkits), can load interfaces from external XML specifications, instead of constructing widgets with procedural language as actual code. [...]

http://doc.trolltech.com/4.4/designer-u … processing

Qt also has this feature. Designer generates .ui files internaly as xml, so they are language independent. You can load the same .ui with any language that has Qt bindings (PyQt for example), just like with gtk and glade.

Both libraries have their pros and cons. Take a look at couple of tutorials and chose the one which suits you more.

Last edited by Adams (2008-09-04 13:48:58)


"The bureaucracy is expanding to meet the needs of an expanding bureaucracy"

Offline

#8 2008-09-04 14:51:05

robmaloy
Member
From: Germany
Registered: 2008-05-14
Posts: 263

Re: C++ && Gui

flip a coin.

or write a ncurses interface!

or just leave it CLI (if GUI isnt explicitly required)


☃ Snowman ☃

Offline

#9 2008-09-13 22:42:11

dante4d
Member
From: Czech Republic
Registered: 2007-04-14
Posts: 176

Re: C++ && Gui

I was very happy when using FormLayout from JGoodies and Java for interfaces, then wrap C++ code inside. Maybe just because Eclipse refactors and formats code nicely big_smile. If you are going to create some simple GUI, I'd try to use YAGNI approach (you ain't gonna need it) - decide if you need some "complex" widgetry libs (takes longer to learn them, then it's simple to use) or just need few simple API calls to create bunch of GUI elements (quick & dirty, harder to maintain if it gets too big). My opinion.

Offline

Board footer

Powered by FluxBB