Graphical Development Tools


Fedora Core includes a number of graphical prototyping and development environments for use during X sessions. If you want to build client software for KDE or GNOME, you might find the KDevelop, Qt Designer, and Glade programs extremely helpful. You can use each of these programs to build graphical frameworks for interactive windowing clients, and you can use each of them to automatically generate the necessary skeleton of code needed to support a custom interface for your program.

Using the KDevelop Client

You can launch the KDevelop client (shown in Figure 33.1) from the desktop panel's start menu's Extras, Programming menu item or from the command line of a terminal window, like this:

$ kdevelop &


Figure 33.1. KDE's KDevelop is a rapid prototyping and client-building tool for use with Linux.


After you press Enter, the KDevelop Setup Wizard runs, and you are taken through several short wizard dialogs that set up and ensure a stable build environment. You must then run kdevelop again (either from the command line or by clicking its menu item under the desktop panel's Programming menu). You will then see the main KDevelop window and can start your project by selecting KDevelop's Project menu and clicking the New menu item.

You can begin building your project by stepping through the wizard dialogs. When you click the Create button, KDevelop automatically generates all the files that are normally found in a KDE client source directory (including the configure script, which checks dependencies and builds the client's makefile). To test your client, you can either first click the Build menu's Make menu item (or press F8) or just click the Execute menu item (or press F9), and the client is built automatically. You can use KDevelop to create KDE clients, plug-ins for the konqueror browser, KDE kicker panel applets, KDE desktop themes, Qt library-based clients, and even programs for GNOME.

Trolltech's Qt Designer

A development environment that is related to KDevelop and is included with Fedora Core is Trolltech's Qt Designer. You can use this program to build user interface "forms" for cross-platform applications. Qt Designer has a complex interface that supports drawing of windows, buttons, and other client controls. You can start Qt Designer from the command line of a terminal window like this:

$ designer &


You can also start the prototyping environment by clicking its menu item under the Programming menu's More Programming tools menu. The Qt Designer main window (as shown in Figure 33.2) provides tools to quickly build and preview a graphical client. After first creating a directory to hold the project files, start by choosing File, New Menu to create a new project. Then you can select a C++ project and save it with a name that ends with .pro.

Figure 33.2. Trolltech's Qt Designer is, like KDevelop, a capable prototyping and client-building tool for use with Linux and X.


Next you can again use the File menu to add a file, but this time, you select a window, widget, or dialog, depending on the graphical interface you'd like to add to your project. After you design the program's GUI, you can preview your design by using the Preview menu. You can also test a build of the new client if you have added enough requisite code. You begin by navigating to your project's folder (using the cd command), and then you use the qmake and make commands, like this:

$ qmake -o Makefile myproject.pro $ make $ ./myproject


The Glade Client for Developing in GNOME

If you prefer to use GNOME and its development tools, the Glade GTK+ GUI builder (the glade-2 client) can save you time and effort when building a basic skeleton for a program. You launch glade-2 from the desktop panel's Programming menu or from the command line of a terminal window, like this:

$ glade-2 &


When you launch Glade, a directory named Projects is created in your home directory, and you see a main window, along with two floating palette and properties windows (see Figure 33.3, which shows a basic GNOME client with a calendar widget added to its main window). You can use Glade's File menu to save the blank project and then start building your client by clicking and adding user interface elements from the Palette window. For example, you can first click the Palette window's Gnome button and then click to create your new client's main window. A window with a menu and a toolbar appearsthe basic framework for a new GNOME client!

Figure 33.3. The GNOME Glade client can be used to build and preview a graphical interface for a custom GNOME program.


When you finish building the client, you can select Build Source Code from the Project window's File menu, and Glade builds the necessary source code and scripts for the project. You can then build the project's configure script by executing the autogen.sh script in the project directory, like so:

$ ./autogen.sh


After you set up the project, as with KDevelop projects, you are ready to configure, build, and install your project. To begin that process, execute the following:

# make install


You will have to add code to fill in the actions for your new KDE or GNOME client when using these rapid prototyping tools. But kdevelop, designer, and glade can help save development time and effort. Use these environments to create a working skeleton application, and then fine-tune your new client's user interface.

Related Fedora Core and Linux Commands

You will use many of these commands when programming in C and C++ for Linux:

ar The GNU archive development tool

as The GNU assembler

autoconf The GNU configuration script generator

cervisia A KDE client that provides a graphical interface to a CVS project

cvs A project revision control system

designer Trolltech's graphical prototyping tool for use with Qt libraries and X

gcc The GNU C/C++ compiler system

gdb The GNU interactive debugger

glade-2 The GNOME graphical development environment for building GTK+ clients

gprof The GNU program profiler

kdevelop The KDE C/C++ graphical development environment for building KDE, GNOME, or terminal clients

make A GNU project management command

patch Larry Wall's source patching utility

pmake A BSD project management command

rcs A suite of programs used to manage project documents

splint The C source file checker

xmkmf A shell script for X that is used to create a localized makefile for building an X client




Red Hat Fedora 5 Unleashed
Red Hat Fedora 5 Unleashed
ISBN: 067232847X
EAN: 2147483647
Year: 2004
Pages: 362

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net