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
13
votes
7 answers

Stock Icons not shown on buttons

self.button = gtk.Button(stock=gtk.STOCK_DELETE) Only Shows: Delete
aberkowitz
  • 147
  • 1
  • 1
  • 7
13
votes
2 answers

How to sort tree view on click on column header

I am having a GtkTreeView with GtkTreeStore in it and I want to Sort this entire table (GtkTreeView) when user clicks on any of the column headers I also want to align text in the cells to left side. How to do this?
User7723337
  • 11,857
  • 27
  • 101
  • 182
13
votes
3 answers

How to escape characters in Pango markup?

My program has a gtk.TreeView which displays a gtk.ListStore. The gtk.ListStore contains strings like this: ""+site_title+""+"\n"+URL Where URL is (obviously) a URL string. Sometimes there are characters in URL…
Isaiah
  • 4,201
  • 4
  • 27
  • 40
13
votes
3 answers

How to hide Gtk Popup Window when user clickes outside the window

I have developed one popup window (Non decorated) using GTK+ and glade tool in C. It popup on its parent window when a button clicked. I want to destroy or hide this popup window when user clicks out side this window. User can click on parent…
kbalar
  • 359
  • 2
  • 5
  • 16
13
votes
1 answer

GTK# in Visual Studio 2010

I've been trying all day to get GTK# working in Visual Studio 2010 on Windows Server 2008 R2 x64 so that I can start writing nice cross-platform GUI applications, but I'm somewhat new to C# and I'm having a world of trouble. I installed the latest…
HOLOGRAPHICpizza
  • 975
  • 1
  • 9
  • 14
12
votes
2 answers

How does GUI output work from application to hardware level?

I am getting into GUI programming and did some research. Now not everything is clear to me. If I would use GTK+ as toolkit, how does it communicate with the graphics card? On a Linux system I suppose it would be GTK --> X Server --(OpenGL)-->…
mbert
  • 1,495
  • 2
  • 11
  • 17
12
votes
3 answers

Which is the best GUI designer for GTK apps?

I want a visual GUI designer that will produce XML output in the format used by GtkBuilder. Glade seems to be the most powerful, although Gazpacho is more lightweight. Stetic (included with MonoDevelop) seems to be good but I don't believe it…
quikchange
  • 564
  • 2
  • 6
  • 14
12
votes
2 answers

Understanding gi.repository

I have troubles understanding gi.repository I use this contruction in my code from gi.repository import Gtk But if I want to use some component I get import error I searched and I got it worked for some components, like GtkSource, Vte, GLib, ... So…
Jan Vorcak
  • 19,261
  • 14
  • 54
  • 90
12
votes
7 answers

Should I learn GTK+ or GTKMM?

I am a C# programmer who started using ubuntu about 2 years ago. I'm wanting to learn GUI programming in either C or C++. I don't really like mono, it tends to crash on my system. I have a basic understanding of C++. I have never worked in C, but it…
Kredns
  • 36,461
  • 52
  • 152
  • 203
12
votes
2 answers

How can I get the full file path of an icon name?

How can I get the full file path from an icon name in GNOME?
david4dev
  • 4,854
  • 2
  • 28
  • 35
12
votes
2 answers

use the system monospace font in gtk textview

I would like to have a GtkTextView in my (Python) program which shows text with the system monospace font. I found many ways which use an expicit font family name and size. However, I would like to use the system specified monospace font (e.g. from…
user450766
  • 133
  • 1
  • 5
12
votes
1 answer

HOWTO: Idiomatic Rust for callbacks with gtk (rust-gnome)

I am currently learning Rust and looking to use it for developing a GUI based application with GTK+. My problem relates to registering callbacks to respond to GTK events/signals and mutating state within those callbacks. I have a working but…
Geoff French
  • 148
  • 1
  • 9
12
votes
2 answers

python GTK3 limit label width

I've got a set of labels in a flowbox, the problem is that I would like for these labels to be 96px wide at most. I've set label.set_ellipsize(True), but since the flowbox gives them as much room as they like they don't get ellipsized, even though…
doxin
  • 698
  • 1
  • 7
  • 22
12
votes
1 answer

CentOS 6.5: Howto install GTK version 2.8.0?

I am running CentOS 6.5, kernel2.6.32-431.5.1.el6.x86_64 #1 SMP. I am trying to install Rattle - data mining tool for R programming language. Rattle is installed from R shell. Notwithstanding I have latest GTK installed, when trying to install…
dokondr
  • 3,389
  • 12
  • 38
  • 62
12
votes
2 answers

How to disable accelerators when typing text in GTK+

I'm using some predefined accelerators connected with certain hot keys. Is it possible to temporarily disable them? I don't want to change the hot keys, in order not to confuse users. The accelerators are activated when typing into a combo box,…
user3484510
  • 121
  • 2