The layout is a little strange with respect to example code. The chapters in the second section each cover an example application, aimed at showing off what was learned in the first section. The third section, however, has its example code as the last two of its four chapters. The fourth section has the examples intermixed in each chapter. I would have expected examples simply to be intermixed with each chapter.
|Published (Last):||11 December 2009|
|PDF File Size:||19.23 Mb|
|ePub File Size:||7.44 Mb|
|Price:||Free* [*Free Regsitration Required]|
The layout is a little strange with respect to example code. The chapters in the second section each cover an example application, aimed at showing off what was learned in the first section. The third section, however, has its example code as the last two of its four chapters.
The fourth section has the examples intermixed in each chapter. I would have expected examples simply to be intermixed with each chapter. Chapter 2 describes glib, the library of utility routines for handling hashes, linked lists and memory management. However, some widgets make use of certain glib features directly, so it helps to become familiar with what it is and what it does.
Chapters 5 and 6 also describe widgets. Although several chapters are on widgets, you need to realize they can be fairly complex and offer many options and their accompanying support and convenience routines. No widget description takes up more than two pages except the Clist and Text widgets, which are introduced very late in the book. Motif was limited in some areas, and not having source made it difficult to extend it. Plus, I think the programmer wanted to work on a widget set from scratch anyway.
Eric describes accurately how to build applications using a single command line, including the recommended use of the gtk-config script. The section on container widgets in Chapter 3 could have used some finer detail.
Packing with boxes and tables is often a confusing area for recent converts. Chapter 4 starts off with some discussion on the casting of widgets. The discussion in the text is good but brief. On page 51, Eric had a somewhat strange segue into the paragraph on signals after finishing off the discussion on casting. The information is useful, though it seemed to come in out of the blue. The rest of Chapter 4 introduces the reader to labels, buttons, text input known as entry widgets , simple lists, combo boxes lists with text input fields , option menus and generic containers widgets that hold other widgets.
Chapters 4, 5 and 6 are descriptions of various widgets. Chapter 7 begins the second section and its example applications.
Whether that will mean applications using the widget will no longer work is unknown. These changes will probably not happen for some time, however. One problem with printed texts is the amount of time it takes publishers to get them to market and onto shelves.
I believe Eric was working with version 1. Some of the examples, although they work, use outdated functions. The correct function to use with GTK 1. Thus, they must be wrapped in other widgets. For event handling, you would drop the label inside a GtkEventBox widget. Chapters 10 through 13 make up the third section, covering issues relating to color and drawing with low-level GDK routines.
I found chapter 10 to be the most useful, as I finally figured out how to do double buffering. Double buffering is simply a matter of drawing in an off-screen non-visible region—a pixmap—and then copying that region over the currently visible version.
The technique is simple once you learn it. Eric explains double buffering clearly and provides good examples of how to use it. Chapter 11 moves into styles, colors and fonts. The discussion here is like the rest of the text: brief but accurate.
The styles section, however, talks about the use of styles programmatically. The latter allow external definition of command-line arguments, for example. Currently, gtkrc strictly handles look-and-feel issues. It comes in gzipped tar format, with the examples broken out into chapter-by-chapter directories.
There is no top-level Makefile, but the individual directories build easily enough. Be sure to have the gtk-config script in your path. Most of the applications worked fine for me. But you should pay attention to that example. Considering the introductory nature of this book, I wonder how useful the last chapter on writing your own widgets will be to others. This space might have been better used to cover more details on widget specifics.
The book has few typos—on-line documentation is notorious for poor editing, which is one reason why printed, professional documentation is here to stay. It is not a reference, and leaves much to be desired regarding in-depth widget explanations. Michael J. He wanders the planet aimlessly in search of adventure, quiet beaches and an escape from the computers that dominate his life.
Kik This has the effect that when the button is clicked, the whole GTK window is destroyed. The compiler will abort with an error if any other header is directly included. The buttons which this box will contain can either be stored horizontally or vertically but this does not matter in seveloping particular case as we are dealing with only one button. Create a new file with the following content named example Christopher Long added it Jul 22, Meredith Wills added it Jul 22, Widgets are organized in a hierachy. Trivia About Developing Linux The window widget is the main container.
Developing Linux Applications with GTK+ and GDK
The layout is a little strange with respect to example code. The chapters in the second section each cover an example application, aimed at showing off what was learned in the first section. The third section, however, has its example code as the last two of its four chapters. The fourth section has the examples intermixed in each chapter.