GTK+ FAQ

Tony Gale

Shawn Amundson

Emmanuel Deloget

This document is intended to answer questions that are likely to be frequently asked by programmers using GTK+ or people who are just looking at using GTK+.

Note: This FAQ mainly covers GTK+ 1.2. Where the text covers GTK+ 2.x this will be indicated


Table of Contents
1. General Information
1.1. Note: This FAQ is undergoing conversion to GTK+ 2.x
1.2. Before anything else: the greetings [GTK 2.x]
1.3. Authors [GTK 2.x]
1.4. What is GTK+? [GTK 2.x]
1.5. What is the + in GTK+? [GTK 2.x]
1.6. Does the G in GTK+, GDK and GLib stand for? [GTK 2.x]
1.7. Where is the documentation for GTK+? [GTK 2.x]
1.8. Is there a mailing list (or mailing list archive) for GTK+? [GTK 2.x]
1.9. How to get help with GTK+ [GTK 2.x]
1.10. How to report bugs in GTK+ [GTK 2.x]
1.11. Is there a Windows version of GTK+? [GTK 2.x]
1.12. What applications have been written with GTK+? [GTK 2.x]
2. How to find, configure, install, and troubleshoot GTK+
2.1. What do I need to compile GTK+? [GTK 2.x]
2.2. Where can I get GTK+? [GTK 2.x]
2.3. How do I configure/compile GTK+? [GTK 2.x]
2.4. When compiling GTK+ I get an error like: make: file `Makefile' line 456: Syntax error [GTK 2.x]
2.5. I've compiled and installed GTK+, but I can't get any programs to link with it! [GTK 2.x]
2.6. When installing a GTK+ application, configure reports that it can't find GTK. [GTK 2.x]
3. Development of GTK+
3.1. What's this Git thing that everyone keeps talking about, and how do I access it? [GTK 2.x]
3.2. How can I contribute to GTK+? [GTK 2.x]
3.3. How do I know if my patch got applied, and if not, why not? [GTK 2.x]
3.4. What is the policy on incorporating new widgets into the library? [GTK 2.x]
3.5. Is anyone working on bindings for languages other than C? [GTK 2.x]
4. Development with GTK+: the begining
4.1. How do I get started? [GTK 2.x]
4.2. How do I use the Glade GUI builder with GTK+? [GTK 2.x]
4.3. How do I write security sensitive/SUID/SGID programs with GTK+? Is GTK+ secure? What's this GTK_MODULES security hole I heard about? [GTK 2.x]
4.4. I tried to compile a small Hello World of mine, but it failed. Any clue? [GTK 2.x]
4.5. What about using the make utility? [GTK 2.x]
4.6. I use the backquote stuff in my makefiles, but my make process failed. [GTK 2.x]
4.7. I want to add some configure stuff, how could I do this? [GTK 2.x]
4.8. I try to debug my GTK+ application with gdb, but it hangs my X server when I hit some breakpoint. Any Idea? [GTK 2.x]
5. Development with GTK+: general questions
5.1. What widgets are in GTK?
5.2. Is GTK+ thread safe? How do I write multi-threaded GTK+ applications? [GTK 2.x]
5.3. I'm doing some stuff with GTK+ in a separate thread, and properly locking with gdk_threads_enter/gdk_threads_leave() but the display doesn't update properly. [GTK 2.x]
5.4. What's an easy way to run a function in the thread with the main loop? [GTK 2.x]
5.5. Why does this strange 'x io error' occur when I fork() in my GTK+ app? [GTK 2.x]
5.6. Why don't the contents of a button move when the button is pressed? Here's a patch to make it work that way... [GTK 2.x]
5.7. How do I identifiy a widgets top level window or other ancestor? [GTK 2.x]
5.8. How do I get the Window ID of a GtkWindow? [GTK 2.x]
5.9. How do I catch a double click event? [GTK 2.x]
5.10. By the way, what are the differences between signals and events?
5.11. Data I pass to the delete_event (or other event) handler gets corrupted.
5.12. I have my signal connected to the the (whatever) event, but it seems I don't catch it. What's wrong?
5.13. I need to add a new signal to a GTK+ widget. Any idea?
5.14. Is it possible to get some text displayed which is truncated to fit inside its allocation?
5.15. How do I make my window modal? / How do I make a single window active?
5.16. Why doesn't my widget (e.g. progressbar) update? [GTK 2.x]
5.17. How do I attach data to some GTK+ object/widget? [GTK 2.x]
5.18. How do I remove the data I have attached to an object?
5.19. How do I reparent a widget?
5.20. How could I get any widgets position?
5.21. How do I set the size of a widget/window? How do I prevent the user resizing my window? [GTK 2.x]
5.22. How do I add a popup menu to my GTK+ application?
5.23. How do I disable or enable a widget, such as a button?
5.24. Shouldn't the text argument in the gtk_clist_* functions be declared const?
5.25. How do I render pixels (image data) to the screen?
5.26. How do I create a pixmap without having my window being realized/shown?
5.27. How do I do drag-and-drop?
5.28. Why does GTK+/GLib leak memory?
6. Development with GTK+: widget specific questions
6.1. How do I find out about the selection of a GtkList?
6.2. How do I stop the column headings of a GtkCList disappearing when the list is scrolled?
6.3. I don't want the user of my applications to enter text into a GtkCombo. Any idea?
6.4. How do I catch a combo box change?
6.5. How can I define a separation line in a menu?
6.6. How can I right justify a menu, such as Help?
6.7. How do I add some underlined accelerators to menu items?
6.8. How can I retrieve the text from a GtkMenuItem?
6.9. How do I right (or otherwise) justify a GtkLabel?
6.10. How do I set the background color of a GtkLabel widget?
6.11. How do I set the color and font of a GtkLabel using a Resource File?
6.12. How do I configure Tooltips in a Resource File?
6.13. I can't add more than (something like) 2000 chars in a GtkEntry. What's wrong?
6.14. How do I make a GtkEntry widget activate on pressing the Return key?
6.15. How do I validate/limit/filter the input to a GtkEntry? [GTK 2.x]
6.16. How do I use horizontal scrollbars with a GtkText widget?
6.17. How do I change the font of a GtkText widget?
6.18. How do I set the cursor position in a GtkText object?
7. About GDK
7.1. What is GDK?
7.2. How do I use color allocation?
8. About GLib
8.1. What is GLib?
8.2. How can I use the doubly linked lists?
8.3. Memory does not seem to be released when I free the list nodes I've allocated
8.4. Why use g_print, g_malloc, g_strdup and fellow glib functions?
8.5. What's a GScanner and how do I use one?
9. GTK+ FAQ Contributions, Maintainers and Copyright