LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2004, 01:42 PM   #1
elitecodex
Member
 
Registered: Feb 2004
Location: MD
Distribution: Fedora 9
Posts: 129

Rep: Reputation: 15
APIs


Hello all!

Im a programmer that has been blinded by Windows ever since I was on computers. I have recently jumped over to Mandrake 9 and am interesting in programming on the linux platform. I know C++ very well, however... I was looking for someplace to start in Linux for GUI programming.

I have read posts about Glade, Qt, OpenGL and maybe even some others... I have heard of them and my problem is that I dont know what role they play. I am familiar with Windows API and was wondering if someone could draw a relation to that to make it clearer? What exactly is Glade and Qt and how do they work? Are they just seperate APIs for GUI programming or are they made for different purposes? Is it like MFC for Windows? There are many more questions, but until I understand the basics, I will save those

Im sure lucky I found this forum


Thanks for any and all input!

Will
 
Old 03-01-2004, 04:58 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Qt and GTK are toolkits (like MFC, probably). Qt is C++ based, when GTK is rather for C (but can ne used with C++). Both Qt and GTK are "over" plain X (you can program in plain Xlib if you wish, but that's harder).

Glade and Qt Designer are tools to design GUI apps. They're graphical and allow you to "draw" windows and so on. Plus they generate code you can include in your program. They're well documented, so you can try hem reading tutorials. Glade is for GTK, Qt Designer is for Qt (that was easy to guess).

Edit: Qt and GTK functionality is similar (well...) to MFC, but the way they work is different. Just try one of them, read basic tutorial and you'll know what I mean.

PS I may be wrong, I'm not a Windows programmer.

Last edited by Mara; 03-01-2004 at 05:00 PM.
 
Old 03-01-2004, 05:33 PM   #3
elitecodex
Member
 
Registered: Feb 2004
Location: MD
Distribution: Fedora 9
Posts: 129

Original Poster
Rep: Reputation: 15
So is there any advantage to using Qt over GTK or vise-versa? Im very knowledgeable in C++, so should I stick with Qt? Ive seen alot of applications that require GTK.

Thanks for your input Mara. Do you have any recommendations for basic tutorials?
 
Old 03-01-2004, 09:57 PM   #4
Chris Weimer
Member
 
Registered: Jan 2004
Location: NYC
Distribution: Fedora XFCE
Posts: 91

Rep: Reputation: Disabled
If you are a fan of Win32, go for XLib - torture leads to the ultimate acension
 
Old 03-01-2004, 10:23 PM   #5
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I'm kind of in the same situation. I pretty much know Windows programming inside and out, and am now learning some X programming.

What I've learnd so far is that Xlib is fairly comparable to the Win32 API. But, despite the similarities, there are still enough differences in how things are done to make things challenging. Many of the other libraries seem to provide a higher level abstraction layer to Xlib, the same way MFC, .Net forums, etc. provide a higher level abstraction layer to the Win32 API.

I haven't looked at anything other than Xlib and Xt yet, but I'm guessing that much like learning the Win32 API gives you insight into how MFC et. al. work underneath, learning Xlib would give you insight into how all the higher level libraries for X work underneath.

Last edited by deiussum; 03-01-2004 at 10:25 PM.
 
Old 03-02-2004, 06:00 AM   #6
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32
You can also program in C++ for gtk+. You have to use the C++ wrapper classes, gtkmm, for this
 
Old 03-02-2004, 07:54 AM   #7
elitecodex
Member
 
Registered: Feb 2004
Location: MD
Distribution: Fedora 9
Posts: 129

Original Poster
Rep: Reputation: 15
Thank you all for your input.

I think I will take a look at straight Xlib first. Depending on how that goes, I will probably go towards Qt.

I never liked MFC, and found the Win32API was much easier in windows... perhaps the same will be true in linux

Thanks again to all!!
 
Old 03-02-2004, 04:39 PM   #8
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I saw an MFC program drawing a window and something inside and it was loooooong. In Qt/GTK it's much easier (and shorter). So comparing MFC and Qt/GTK is probably not the best idea.
 
Old 03-02-2004, 09:32 PM   #9
elitecodex
Member
 
Registered: Feb 2004
Location: MD
Distribution: Fedora 9
Posts: 129

Original Poster
Rep: Reputation: 15
Mara

I agree. MFC code is so over bloated its not funny. I will read both Qt and Xlib tutorials, but probably focus on Qt. Seems like the way to go
 
Old 03-03-2004, 10:18 AM   #10
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
http://www.ac3.edu.au/SGI_Developer/...b_PG/sgi_html/
id say thats the best xlib tutorial (for some reason theres not much tutorials with exaples, either an explanation, or just the plain functions with no info on how they work

as for GTK vs QT, id take GTK only cuse the apps i like are made for it, but its realy up to you
and if your planing to make any programs with user interfaces then defidently go with a toolkit as that will handle most of the hard stuff for you in dealing with the X windowing system
 
Old 03-03-2004, 10:32 AM   #11
delta9
Member
 
Registered: Dec 2003
Distribution: Gentoo
Posts: 66

Rep: Reputation: 15
I would suggest you look into QT, it's a very clean and powerful toolkit (KDE is built on it) and more than just a GUI library. Check the homepage at www.trolltech.com, the online documentation is very extensive!

Last edited by delta9; 03-05-2004 at 05:53 AM.
 
Old 03-03-2004, 10:56 AM   #12
elitecodex
Member
 
Registered: Feb 2004
Location: MD
Distribution: Fedora 9
Posts: 129

Original Poster
Rep: Reputation: 15
I do notice that a great deal of apps I use, the requirements always make mention to GTK... I dont see too many apps based on Qt (at least they dont specify it). Is there any particular reason for this? What are some apps that require Qt?
 
Old 03-03-2004, 03:38 PM   #13
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
It's mostly programmmer's personal preference. Many apps require Qt, I think that the ratio is equal.
 
Old 03-03-2004, 11:05 PM   #14
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Xlib is a great way to learn about the bowels of X11, but take heed, it is for the true mashochist at heart. It is more accurate to compare Xlib with just the Win32 GDI and window messaging API. You're going to have a much harder time writing Xlib code than Win32. No functions for doing dialog boxes, menus, advanced controls etc.
 
Old 03-04-2004, 04:48 PM   #15
Chris Weimer
Member
 
Registered: Jan 2004
Location: NYC
Distribution: Fedora XFCE
Posts: 91

Rep: Reputation: Disabled
and forget those nifty resource files. Much harder here. But hey, it is well worth it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASE64 APIs? EddyHahn Programming 0 11-29-2004 09:59 PM
Problem using DB2 Vendor APIs shitij Linux - Software 0 08-17-2004 01:36 AM
Windows APIs on Linux ?? sheenak Programming 2 07-02-2004 06:30 AM
equivalent to these APIs meshmesh Linux - Software 2 12-31-2003 03:52 AM
Star office APIS saravanan1979 Linux - Software 2 06-28-2002 11:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration