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
3
votes
1 answer

How to disable white drop shadow in label?

I have a Label for which I want to set the foreground color. However, there is also a white shadow/outline: I've set the Foreground to a color (Blue): // This is GTK# in MonoDevelop on Mac OS X var fg = new Gdk.Color (); Gdk.Color.Parse ("#0000ff",…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
3
votes
0 answers

gtk treeview column resizing and horizontal scrollbar

I have a gtk treeview (inside a GtkScrolledWindow) with two columns. If I set both columns to the default sizing policy, I have a horizontal scrollbar for the treeview but the columns can't be sized down by the user, which is impractical. If I set…
Emmanuel Touzery
  • 9,008
  • 3
  • 65
  • 81
3
votes
2 answers

How to translate pygtk; glade; gtk.Builder() application?

This is my first trial in translating pygtk glade; I have created Rockdome.mo file on the following dir:./locale/ar/LC_MESSAGES/Rockdome.mo def apply_locale(self , lang): domain = "Rockdome" local_path = basefolder+"/locale" …
esnadr
  • 427
  • 3
  • 18
3
votes
3 answers

Invisible text in JetBrains' PyCharm window in GNOME 3

I installed PyCharm and I got these windows with no text: Logs show no apparent error. I've installed ttf fonts package from AUR. What could be the reason?
SiddharthaRT
  • 2,217
  • 4
  • 20
  • 28
3
votes
1 answer

How to deiconify a window after the click of minimize button in GTK

Here is my test code (running on Ubuntu 14.04): try: from gi.repository import Gtk,Gdk,GObject except ImportError: import gtk as Gtk import gtk.gdk as Gdk import gobject as GObject def deiconify( widget ): print 'deiconifying…
zhujs
  • 543
  • 2
  • 12
3
votes
1 answer

hexagon buttons in GTK+

I am trying to create a button in GTK+ that has the shape of a Hexagon. How can I do it without using CSS? And more general, how can I create my button in any shape I want? Is it possible to do such things in Glade(User interface edior for GTK+)?
AmirSojoodi
  • 1,080
  • 2
  • 12
  • 31
3
votes
1 answer

Mouse event in DrawingArea with PyGtk

I want to get the X and Y coordinates when I click on a DrawingArea. I was looking for some examples and I found a code like the following import gtk class Ventana(gtk.Window): def __init__(self): super(Ventana, self).__init__() …
Adrian
  • 829
  • 5
  • 14
  • 21
3
votes
3 answers

Python process does not exit on GTK loop exit

problem I am loosely following this Python GTK tutorial, but the Python process itself does not exit after the gtk main loop is exited, and does not respond to a terminal interrupt either--it has to be killed (SIGTERM). Here is my complete…
bright-star
  • 6,016
  • 6
  • 42
  • 81
3
votes
1 answer

Python gtk: How to insert items from list to combobox

I'm having an issue with inserting items from existing list to combo-box, here is my code: #retrieving data: cursor = self.__db.cursor() cursor.execute("select * from some_table") #creating a list: row =…
Eli
  • 4,576
  • 1
  • 27
  • 39
3
votes
4 answers

C code compilation failure

i have this makefile below and in it my includes are gtk/gtk.h and webkit/webkit.h but when i try to build the project using the make command i have the errors error: gtk/gtk.h: No such file or directory error: webkit/webkit.h: No such file or…
user248230
  • 101
  • 1
  • 2
  • 5
3
votes
1 answer

Python Gtk2 & Vte wait for the process Pid is finish

I'm using the VTE module in a GTK window, to run and show the result of a bash script. adresse = self.champ.get_text() pid = self.v.fork_command(None, ['/bin/bash', "./pluzz.sh", adresse]) if pid == None: #pseudocode …
Guillaume
  • 2,752
  • 5
  • 27
  • 42
3
votes
3 answers

How do you rotate a gtk widget?

Let's say the widget in question is a VBox containing a Label and two Buttons. Furthermore, let's say the degree of rotation desired is 90°. How does one go about rotating it? I do not think this is possible by default but I do think it is…
Fake Code Monkey Rashid
  • 13,731
  • 6
  • 37
  • 41
3
votes
1 answer

Dump X clipboard data with GTK+ or PyGTK

How do I paste HTML data from the X clipboard using PyGTK/GTK+? I would need something like xclip, but with the ability to output clipboard data as HTML, not just as plain text. I'm using PyGTK, but I am not afraid of plain GTK+ in C. I've read…
Danilo Piazzalunga
  • 7,590
  • 5
  • 49
  • 75
3
votes
2 answers

Key binding for window/app in python Gtk+ 3 without menu items, UI manager, etc

I'm trying to use GTK3 and Cairo from Python for a minimal plotting application where the on-screen display of Cairo's output is for user convenience. The typical usage is that I run a command, a plot pops up on screen and is also written to file,…
andybuckley
  • 1,114
  • 2
  • 11
  • 24
3
votes
4 answers

Handling Double Click and Single Click Events in pygtk

I am trying to separate single click events from double click events using glib.timeout_add() and glib.source_remove(). Here is how I am doing it : class Exchange: ''' some code ''' def __init__(self): self.timeoutID_1 = 0 …
Flame of udun
  • 2,136
  • 7
  • 35
  • 79