Questions tagged [gtk3]

The GIMP ToolKit (GTK+) in its version 3.x. GTK+ is a highly usable, feature-rich toolkit for creating graphical user interfaces (GUIs) that boasts cross platform compatibility and an easy to use API.

GTK+ is written in C, but has bindings to many other popular programming languages such as C++ (), Python (), and C# 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.

The latest version is GTK+ 3, released in January, 2011.

For questions not specifically regarding GTK 3, please use instead.

Reference documentation in C

Reference documentation in Python

3219 questions
7
votes
1 answer

How to style a GtkLabel with CSS?

I'm trying to use CSS to style a GtkLabel. I would like to change the color and font size of the label. Here is my C code: #include int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window =…
gsgx
  • 12,020
  • 25
  • 98
  • 149
7
votes
2 answers

using "try" to avoiding a segmentation fault

Recently in one of my programs I got a segmentation fault problem. I managed to find the line that its is causing the problem but I haven't find the way of fixing it. the line: self.window_player.add(self.vlc) where self.vlc is a widget and…
user3672754
7
votes
2 answers

visually debug GTK3 applications (GtkInspector / gtkparasite)

Trying to debug a GTK theme, I modified. Having corrected most of the issues with the theme, I Still cannot figure out, what color setting is responsible for background color in some input-fields or text-views. SETUP I can start GtkInspector as well…
Florian
  • 372
  • 2
  • 12
7
votes
1 answer

How to create custom widget in GTK3 in C?

do you know how do you create a custom widget in GTK 3 ? I tried to subclass GtkDrawingArea in C for hours. Gnome.org only provides a succinct tutorial on how to subclass G_OBJECT. My issue is that G_Object/GTK fails to view my custom…
Lærne
  • 3,010
  • 1
  • 22
  • 33
7
votes
2 answers

gtk_action_group_new() and GtkStock - What to use instead?

The following code is from listing 9-11 of Foundations of GTK+ Development. Through this book, I've been attempting to migrate any GTK2 specific stuff (or any depreciated code for that matter) to learn what's relevant at the present moment. That…
pdm
  • 1,027
  • 1
  • 9
  • 24
7
votes
2 answers

PyCharm - autocomplete for Gtk3 magically stops working

I have this weird problem - I'm learning Gtk3 on Windows 7 with PyCharm Community 3.4.1. When I try to import Gtk: from gi.repository import Gtk it underlines Gtk as unresolved reference, becouse it's a binary module. Then I press Alt+Enter and…
DiPi
  • 99
  • 1
  • 7
7
votes
2 answers

GTK3 Dialog in Python, "enter key" on a Gtk.Entry should trigger the OK Button

I have following code written in Python with Gtk3. from gi.repository import Gtk class DialogTaskDescription(Gtk.Dialog): def __init__(self): Gtk.Dialog.__init__(self, "Create ToDo.txt Entry", 0, 0, (Gtk.STOCK_CANCEL,…
7
votes
3 answers

Autocomplete for gtk3 and pygobject

I am looking for a possibility to add autocompletion for gtk3 libs to vim. I have already tried vim-jedi as it seems the state of the art autocompletion mechanism for vim and python (also recommended here), but that does not work for the gtk3 stuff…
flammi88
  • 381
  • 2
  • 14
7
votes
1 answer

GtkTreeView with multiple columns and GtkListStore with single custom type (in Python)

I'm trying to display properties of an object on different columns of a Gtk.TreeView. Say I have the following: class MyClass(GObject.GObject): def __init__(self, first, last, age): self.first = first self.last = last …
jpcgt
  • 2,138
  • 2
  • 19
  • 34
7
votes
4 answers

How to theme the header bar close button in GTK+3?

I'd like to change the style of the close button on GTK+3 windows with so called "header bars", where the window is rendered without decoration and GTK composes title bar and widgets. What kind of element is the "X" close button, and what CSS…
Fabian Knorr
  • 3,134
  • 3
  • 20
  • 32
7
votes
1 answer

How to adjust the size of a GtkGrid cell?

I'm programming a little application in Python + Gtk3. I'm using a GtkGrid with one column and two rows. In the first row I put: a GtkScrolledWindow, and inside it a TreeView with two columns. In the second row I put: a ButtonBox, and inside it a…
skytux
  • 1,236
  • 2
  • 16
  • 19
7
votes
1 answer

How to show a png image in Gtk3 with Python?

First of all, it is important to mention that I'm learning Python and Gtk+ 3, so I'm not an advanced programmer in these languages. I'm trying to make a graphical interface in Gtk3 for a Python script that creates a png image, and I'd like to…
skytux
  • 1,236
  • 2
  • 16
  • 19
7
votes
4 answers

is GTK 3.x a real cross-platform solution?

I have tasted both Qt 4.x/5.x and GTKmm 3.x and I really like GTKmm over Qt. Now I have just discovered that GTKmm 3.x doesn't offer a Windows porting, they also do not offer a Mac porting, basically I can't find nothing but…
user1824407
  • 4,401
  • 4
  • 15
  • 20
7
votes
1 answer

A sorted and filtered treemodel in Python Gtk+3..?

I am trying to get a treemodel (a liststore in fact) that can be filtered and also sorted. I have the following piece of code self.modelfilter = self.liststore.filter_new() self.modelfilter.set_visible_func(\ …
Vijay Murthy
  • 841
  • 2
  • 9
  • 19
7
votes
2 answers

GTK Label wrapping in a dialog

I'm trying to create a non-resizable dialog with a label in it. This label has a lot of text, so I want it to wrap without making the dialog ridiculously wide. For some reason, I can't find out what it takes to get GTK to allow this to happen. I…
Dan
  • 3,665
  • 1
  • 31
  • 39