Questions tagged [gtk]

GTK (formerly GTK+) is a toolkit for creating graphical user interfaces (GUIs) with cross platform compatibility and an easy to use API.

GTK is written in C, and has bindings to many other popular programming languages such as C++ (), Python (, ), C# (), and Perl, among others. GTK+ is licensed under the GNU LGPL 2.1, allowing development of both free and proprietary software with GTK+ without any license fees or royalties.

"GTK" stands for GIMP Tool Kit. It was originally developed to serve as the widget set for The GIMP, the GNU Image Manipulation Program. In the intervening years its usage has expanded greatly.

This tag should be used for questions about GTK in general. For more specific questions regarding how a certain version works, use or .

Reference GTK 3 documentation: http://developer.gnome.org/gtk3/stable/

Reference GTK 2 documentation: http://developer.gnome.org/gtk2/stable/

GTK Java binding - http://java-gnome.sourceforge.net/

GTK 2 Perl binding - https://metacpan.org/pod/Gtk2

GTK 3 Perl binding - https://metacpan.org/pod/Gtk3

Books:

SO Chatroom:

8468 questions
19
votes
5 answers

What are the IDEs available for gtk+ development

Recently i start to studying C/gtk+ programming. And want to ask one question: what are the IDEs available for C/gtk+ development apart from command line interface? Thank you.
0xAX
  • 20,957
  • 26
  • 117
  • 206
19
votes
2 answers

How to disable buttons in GTK3

Windows API has a function called EnableWindow that disables controls so user can't interact with them any more. Is there an equivalent for GTK3 or GTK3++?
felknight
  • 1,383
  • 1
  • 9
  • 25
19
votes
2 answers

Difference between GtkWindow and GdkWindow?

At the beginning of my Gtk-Gdk-Cairo-Pango app, I create the window: GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); First, there is GtkWindow, but gtk_create_window returns GtkWidget, not GtkWindow, why? Then, some functions, like…
exebook
  • 32,014
  • 33
  • 141
  • 226
19
votes
1 answer

GTK: cancel timeout

GTK allows you to set a timeout with g_timeout_add. Just like g_signal_connect, the g_timeout_add function returns an id representing the timeout. So, is there a way to cancel a timeout using the id? Looking through the documentation, I don't see…
Channel72
  • 24,139
  • 32
  • 108
  • 180
18
votes
6 answers

Ruby bindings for GTK+ 3?

I’ve spent some time learning Ruby, and I wanted to move over to some GUI programming. GNOME 3 is the environment most appealing to me at the moment, so I thought I would have a look at GTK+ 3. However, the GTK+ 3 documentation’s Getting Started…
Daniel
  • 4,525
  • 3
  • 38
  • 52
18
votes
4 answers

Finding children of a GtkWidget

I need to be able to explore a GTK GUI's structure programmatically. I have the GtkWidget and I want to find any children of that widget. Now I know that GtkContainer's have a function to find children and that GtkContainer is derived from…
Jonathan Sternberg
  • 6,421
  • 7
  • 39
  • 58
18
votes
4 answers

Gvim redraw issues with Virtual Box and Windows 7 host

Gvim 7.4 on a Linux guest inside VirtualBox has serious redraw issues: often when I scroll up/down, the shown text gets corrupted (e.g., empty or with some "holes"). And I have to resize/rescroll to clean the screen. I've never experienced a similar…
Claudio
  • 10,614
  • 4
  • 31
  • 71
18
votes
3 answers

How can I determine the display idle time from Python in Windows, Linux, and MacOS?

I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer and able to observe…
Glyph
  • 31,152
  • 11
  • 87
  • 129
18
votes
4 answers

Threading problems with GTK

I'm building a fairly simple C application using GTK, but have to perform some blocking IO which will trigger updates to the GUI. In order to do this, I start a new pthread right before gtk_main() as such: /* global variables */ GMainContext…
Jon Gjengset
  • 4,078
  • 3
  • 30
  • 43
18
votes
5 answers

GTK detecting window resize from the user

In GTK (or pygtk or gtkmm...) How can I detect that an application window has been manually resized by the user, as is typically done by dragging the window's edge? I need to find a way to differentiate manual resizes from resizes that originate…
Drew Dormann
  • 59,987
  • 13
  • 123
  • 180
17
votes
5 answers

How to make Gtk+ window background transparent?

I'd like to make the background of a Gtk+ window transparent so that only the widgets in the window are visible. I found a few tutorials: http://mikehearn.wordpress.com/2006/03/26/gtk-windows-with-alpha-channels/ http://macslow.thepimp.net/?p=26 But…
jbeard4
  • 12,664
  • 4
  • 57
  • 67
17
votes
2 answers

Non-ASCII symbols in translation of GTK-GUI in Windows not working?

I have a small python program that shows how to do translations of GTK (pygobject) GUIs for Linux and Windows. Everything works in Linux, but in Windows non-ASCII symbols are not rendered in the translation. I assume that the both the Glade file and…
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
17
votes
1 answer

How do I access GUI (GTK) from multi threads?

I have a worker thread spawned from a GUI (for GUI performance), how do I access GUI, such as spawning new windows/widgets from the thread itself? I tried using delegates but it doesn't seem to be working. Any ideas? Possibly examples? Thank you.
nubela
  • 1
  • 24
  • 75
  • 123
17
votes
2 answers

Building Pango with Cairo support

I'm attempting to build a new version of wireshark 1.10 on a RHEL5 box with the intent of making an RPM so that customers that I support can install it. Possibly others if I can find a place to host it. WS1.10 depends on GTK+ as well as several…
Thomas Lann
  • 1,124
  • 5
  • 17
  • 35
17
votes
4 answers

How to disable/inactive some of the GtkMenu Items

I am trying to disable/inactive some of menu items under GTK+. I have created Menu In GTK+Glade under C, and on some external event I need to disable some of the menu options. How can I do this?
User7723337
  • 11,857
  • 27
  • 101
  • 182