|
|
GTK+ Books
- GTK+ Programming in C
GTK+ Programming in C
by Syd Logan
2002 Prentice Hall
All GTK+ code examples presented in this book had been tested in Ch on Solaris in June, 2003.
Here is a list of bugs existing in the examples of the book.
(1) book/chapter11/packer/packer.c
Ch is powerful in detecting buffer overflow in arrays.
Most C/C++ compilers cannot detect such an error.
Program packer.c contains a buffer overflow bug.
To fix this bug,
change line 26 from
char buf[10];
to
char buf[20];
or use Variable Length Array in C99 as shown at
http://www.softintegration.com/demos/chstandard/c99.html#3
(2) book/chapter11/packer/itemfactory.c
Change line 54 from
static gpointer foo=(gpointer0 0x12345678L;
to
static gpointer foo=(gpointer) 0x12345678L;
(3) book/chapter9/menu/menu.c has a bug.
It needs to be changed from
myMenuItem = (GtkMenuItem *) menu_items =
gtk_check_menu_item_new_with_label (buf);
to
menu_items = gtk_check_menu_item_new_with_label (buf);
myMenuItem = (GtkMenuItem *) menu_items;
(4) book/chapter9/itemfactory2/itemfactory.c
will crash in both compiled C program or run in Ch
when clicking menu inside the window after button
is clicked and hold-on.
Link to download the GTK+ C code
Link to Amazon to buy the book
|