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
14
votes
5 answers

meld - gi._glib.GError: Icon 'meld-change-apply-right' not present in theme. What is wrong with the installation?

I have managed to install the meld 3.14.2 and all the dependency packages, by compiling each package from source and all are installed on a NFS share with --prefix=/meldfor the meld tool && --prefix=/meld/deps for the…
GP92
  • 433
  • 1
  • 12
  • 30
14
votes
3 answers

GTK+-based graph?

I want to be able to make a line graph using GTK+ but I'm unsure how to approach this. Has anyone got any hints or tips?
paultop6
  • 3,691
  • 4
  • 29
  • 37
14
votes
1 answer

How do i make my gtk app use the dark theme?

Some apps on the gnome desktop like the image viewer use a dark variation of the theme. What code is required to make my own gtk program use this dark variation of the theme?
Askaga
  • 6,061
  • 5
  • 25
  • 49
14
votes
5 answers

Creating GUI with Python in Linux

Quick question. I'm using Linux and I want to try making a GUI with Python. I've heard about something like Qt, GTK+ and PyGTK but I don't know what they are exactly and what the difference between them is. Is there any difference on how they work…
Iceland_jack
  • 6,848
  • 7
  • 37
  • 46
14
votes
2 answers

How do I get the gdk window for a gtk window in C?

I'm trying to set the cursor to a watch. The problem is that gdk_set_cursor() requires a gdk_window. How do I get the gdk_window of a gtk_window in C? I've seen examples for gtkmm and pygtk but I can't find the corresponding C function.
Erwin J.
  • 587
  • 1
  • 5
  • 15
13
votes
1 answer

Python + GTK: How to set a selected row on gtk.treeview

I'm trying to do a keyboard command. When I insert S+some_number+Return I need call a function that will see this number on a column on Gtk.Treeview and set that row has selected. How can I do that?
Irish Wolf
  • 211
  • 2
  • 13
13
votes
1 answer

how to keep gtk.window always on top level

I am trying to keep a gtk.window on top, but I'm having trouble. Here is my code so far. The example is in vala gnome (on windows 7). public void onTop() { window.decorated = false; window.modal = true; window.set_keep_above(true); }
rChavz
  • 235
  • 3
  • 16
13
votes
3 answers

How do I get my Emacs to *always* use 6x13 on X11

I recently declared .emacs bankrupcy and reorganized my init stuff. In the process, I ripped out all the hacky font selection stuff I had accrued over the years, figuring there are probably easier ways to accomplish what I want in the most modern…
bendin
  • 9,424
  • 1
  • 39
  • 37
13
votes
2 answers

How to draw any GTK widget on top of Cairo surface

I would like to save the looks of a GTK window, and all the buttons and other widgets it contains to a PNG or PDF file. Cairo supports drawing on such surfaces. Could I somehow ask a GTK widget to draw itself on Cairo surface? A code sample would…
tzador
  • 2,535
  • 4
  • 31
  • 37
13
votes
1 answer

How to embed external window in GUI (Python + Glade + Gtk3)

I started to build a GUI with Glade, python and Gtk3 libraries. I want to try to view an external window linking it inside a container in my GUI. Is it possible? Which is the best container object to do this? I started to search but easy methods in…
marcoresk
  • 1,837
  • 2
  • 17
  • 29
13
votes
2 answers

Comparison of GUI development tools for linux

I am fairly new to the domain of GUI design and development. I do have some prior experience but that is with Visual Basic. I would like to develop a reasonably comprehensive (though not state-of-the-art) GUI application on linux based on a…
puffadder
  • 1,814
  • 3
  • 20
  • 32
13
votes
5 answers

Gtk3 keys bindings in css files

Where can I find an exhaustive list of available keybindings that a user can define in a CSS file for GTK+ 3? I have already checked those…
cedlemo
  • 3,205
  • 3
  • 32
  • 50
13
votes
1 answer

Serialize Gtk TreeStore / ListStore using JSON

I made a new example which shows much better what I am trying to do. The new example gives the following ouput. Is there a way that the data can go into the respective store key (the {} brackets)? { "copy": [ [ [ …
tobias47n9e
  • 2,233
  • 3
  • 28
  • 54
13
votes
6 answers

What's the equivalent of gcc's -mwindows option in cmake?

I'm following the tuto: http://zetcode.com/tutorials/gtktutorial/firstprograms/ It works but each time I double click on the executable,there is a console which I don't want it there. How do I get rid of that console? I tried…
Gtker
  • 2,237
  • 9
  • 29
  • 37
13
votes
1 answer

Asyncio calls running in Gtk main loop

Okey guys question concerning asyncio and Gtk+. How can I run code below in Gtk.main loop ? I searched for example but couldn't find any. #!/usr/bin/python3.4 import asyncio @asyncio.coroutine def client_connected_handler(client_reader,…
harisk92
  • 1,088
  • 1
  • 14
  • 24