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

Set style property in PyGObject

I have a very simple PyGObject application: from gi.repository import Gtk, Gdk class Window(Gtk.Window): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.set_border_width(5) self.progress =…
Fenikso
  • 9,251
  • 5
  • 44
  • 72
6
votes
2 answers

Adding GTK library to CLion

I'm new to GTK and I'm using CLion IDE to code. I'm on Ubuntu and I've installed libgtk-3.0-dev . The headers I've added to my code is: gtk-3.0 gtk-3.0/gtk/gtk.h but when I want to build the project I get this error : fatal error: gtk-3.0: No such…
AmirAhmad
  • 153
  • 3
  • 12
6
votes
1 answer

What is a resource path that have to be used with gtk_builder_new_from_resource?

I understand the what are the arguments for the functions gtk_builder_new_from_file or gtk_builder_new_from_string but I struggle a little to see what is a resource path like: GtkBuilder * gtk_builder_new_from_resource (const gchar…
cedlemo
  • 3,205
  • 3
  • 32
  • 50
6
votes
3 answers

Gtk.CssProvider.load_from_data TypeError: Item 0: Must be number, not str

I was getting this error when running my gtk project from a terminal with python3 myapp.py, but not when launching my app via Sublime-Text-3's python build system! How weird. TypeError: Item 0: Must be number, not str The code at fault was…
ThorSummoner
  • 16,657
  • 15
  • 135
  • 147
6
votes
0 answers

How to write a custom Gtk.CellRenderer which would show Gtk.ColorButton

I am using Python 3 and Gtk+ 3. I have a list of colors stored in a Gtk.ListStore. I want to display these colors as Gtk.ColorButton with a Gtk.CellRenderer so that the users would be able to view the colors and also change the colors too. My…
183.amir
  • 422
  • 3
  • 25
6
votes
2 answers

Is there a manual/list of special Gtk CSS properties?

I'm trying to redesign some Gtk3 widgets in my application (like scrollbars or paned) but was unable to set borders and other properties for paned specifically. I then found some CSS data in /usr/share/themes/Adwaita/gtk-3.0/gtk.gresource, which use…
Kyselejsyreček
  • 459
  • 1
  • 3
  • 16
6
votes
2 answers

How to left align a Gtk Label when its width is set by GtkSizeGroup

I have labels that should be left aligned and should all have the same width. I'm using a GtkSizeGroup to achieve the sizing (because the labels don't all have the same parent). Unfortunately this seems to break alignment: With the below code the…
Jussi Kukkonen
  • 13,857
  • 1
  • 37
  • 54
6
votes
3 answers

Passing additional arguments to gtk function

I'm trying to learn how to make GUIs using gtk+ 3.0. I want to pass a simple argument, an integer, to a callback function, so that when I press the button the value of the argument changes. Here's my code: #include void…
Daniel Jaló
  • 147
  • 1
  • 3
  • 11
6
votes
1 answer

Adding custom widget to GLADE

Hi am using gtk3 and glade 3.14...I want to add a custom widget to glade so that i can add that to my user interface easily. I found knob widget is missing in glade and i found knob widget in http://sourceforge.net/projects/giw/ I downloaded and…
ganeshredcobra
  • 1,881
  • 3
  • 28
  • 44
6
votes
2 answers

Python GTK+ 3 Safe Threading

So what should I run at the beginning of my program to make it thread-safe (or thread-aware as I've read in some places): from gi.repository import Gtk, Gdk, GLib, GObject import threading GLib.threads_init() # ? GObject.threads_init() #…
jpcgt
  • 2,138
  • 2
  • 19
  • 34
6
votes
2 answers

Gtk-ERROR **: GTK+ 2.x symbols detected

I'm compiling my c application with gcc with the following flags: gcc evis.c `pkg-config --cflags --libs gtk+-2.0 --libs clutter-gtk-1.0 --libs gthread-2.0` -Wall -o evis Now my code compiles with a few warnings but still finishes. When I try to…
ReX357
  • 1,199
  • 3
  • 19
  • 43
6
votes
1 answer

Adding a row to ListStore not working - ridiculous exception

First the code: from gi.repository import Gtk, GtkSource, GObject import os.path import shelve class MusicCollection(object): def __init__(self): self.builder = Gtk.Builder() self.glade_file = 'music.glade' …
Siekacz
  • 303
  • 1
  • 9
6
votes
3 answers

Force background of matplotlib figure to be transparent

I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but…
Donagh
  • 165
  • 2
  • 2
  • 6
6
votes
3 answers

GTK3 and Python3 on Windows?

Is there any way to launch a Python3 / GTK3 based application on a Windows machine? It seems that this is not that simple as with GTK2/Python2. Thanks a lot, Thomas
Thomas
  • 1,468
  • 4
  • 14
  • 20
6
votes
0 answers

Giving window focus in Gtk3

I'm using Python 2.7.4 with Gtk3 on Ubuntu 13.10. I'm using the Keybinder library to hide and show my Gtk window using a hotkey. Now, when my window does show up using the hotkey, it does not always receive focus. The concerned code is below: def…
AgilE
  • 592
  • 4
  • 16