Click to See Complete Forum and Search --> : Two big questions about programming under X-windows


carrja99
10-16-2002, 11:11 PM
Well, as for the first... I recently found Qt Designer and was treated to a nice neat VC++ like interface... something nice to show off to my CSC professor with, turning in an assignment that runs in X-windows rather plain console like everyone else.

But my major question is... well, I've spent alot of time going through several different themes and window decorations, and still haven't found one to suit me. How do I go about making my own window decorations?

The other question is... what is a good resource for GUI programming under linux? I'm trying to learn by reading source, but it's a litle hard to take a guy who writes programs that sort arrays or convert numbers to other radices. I am also looking for basically the most simple coding to start off from. LIke what C++ code with what header file would simply bring up a dialog? I can easily build fromt here!

x_Ray
10-16-2002, 11:55 PM
Well, if your using QT I'd have to give the advice everyone hates...RTFM :) Really though QT comes with excellent documentation. It has many examples and walkthroughs, taking you from the simplest "Hello World" button to more complicated applications.

That along with a good book on C++ should take you a long way. I'm not sure of a good book dealing with programming for X specifically, though I'm sure someone can help you with that.

As for the simplest code to bring up an app using QT...taken from the Qt docs (http://doc.trolltech.com/3.0/) :

#include <qapplication.h>
#include <qpushbutton.h>


int main( int argc, char **argv )
{
QApplication a( argc, argv );

QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );

a.setMainWidget( &hello );
hello.show();
return a.exec();
}

Energon
10-17-2002, 11:33 AM
Be careful doing assignments that aren't expected to be graphical. There's about a million and one ways to make a GUI program not run where a console will, and if that happens, it'll probably end in a failing grade (at least, all my professors are that way, if it doesn't run, you fail even if the important stuff is right).

Postal Patron
10-21-2002, 03:21 PM
X Windows is too cumbersome.

Maybe motif would be easier and faster?

bwkaz
10-21-2002, 08:59 PM
Motif is an X toolkit, though. You're still using X if you use Motif (or actually, in Linux, lesstif -- Motif has some issues, legal I believe, so most distros use the free clone instead).