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

ValueError: Namespace Gtk not available

When following the instructions 2. Getting Started — Python GTK+ 3 Tutorial 3.4 documentation Tries In [6]: import gi ...: gi.require_version('Gtk', '3.0') ...: from gi.repository import Gtk it report…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
19
votes
2 answers

How to disable buttons in GTK3

Windows API has a function called EnableWindow that disables controls so user can't interact with them any more. Is there an equivalent for GTK3 or GTK3++?
felknight
  • 1,383
  • 1
  • 9
  • 25
18
votes
3 answers

Proper way of building Gtk3 applications in Python

I have just started learning about creating GUI apps in Python. I decided to use Gtk version 3. According to the (official?) tutorial on http://python-gtk-3-tutorial.readthedocs.org/ the proper way of building a hello world application is: from…
Michał Tabor
  • 2,441
  • 5
  • 23
  • 30
18
votes
4 answers

Threading problems with GTK

I'm building a fairly simple C application using GTK, but have to perform some blocking IO which will trigger updates to the GUI. In order to do this, I start a new pthread right before gtk_main() as such: /* global variables */ GMainContext…
Jon Gjengset
  • 4,078
  • 3
  • 30
  • 43
17
votes
2 answers

How to remove white border in gVim 8 with gtk 3

I recently updated my gVim to version 8 compiled with gtk 3, and I found there are strange inner borders around the gVim window: This picture may not very clear but if you look carefully you can see the white borders on the right side and the…
Jian
  • 3,118
  • 2
  • 22
  • 36
17
votes
2 answers

Cairo GTK draw a line with transparency (like a highlighter pen)

I am trying to create a simple drawing application using Python, GTK3 and cairo. The tool should have different brushes and some kind of a highlighter pen. I figured I can use the alpha property of the stroke to create it. However, the connecting…
oz123
  • 27,559
  • 27
  • 125
  • 187
16
votes
1 answer

Can't import Webkit from gi.repository

When I try to import Webkit from gi.repository, it gives an ImportError: from gi.repository import Webkit ERROR:root:Could not find any typelib for Webkit Traceback (most recent call last): File "", line 1, in ImportError: cannot…
Abhilash Nanda
  • 339
  • 2
  • 4
  • 13
16
votes
5 answers

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native. I have installed gtkmm3 and gtk3 in MSYS2 and I am…
kracejic
  • 723
  • 1
  • 6
  • 17
15
votes
2 answers

gtk_widget_add_tick_callback() and gtk_main_iteration()

I have two GTK windows Normal (main) window that runs animation, draws stuff in callback registered by gtk_widget_add_tick_callback(). At some point secondary window is created that runs modal loop: void show_modal() { GtkWindow* gw =…
c-smile
  • 26,734
  • 7
  • 59
  • 86
15
votes
3 answers

GLib-GIO-ERROR**: No GSettings schemas are installed on the system

Unfortunately, I am using Windows (Windows7 x64). With MinGW compiler in Code::Blocks and GTK+3.6.4. I compiled manually all the schemas from glib. When I use File Chooser dialogue / colorpicker - it doesn't matter, I am getting the following…
DeltaProxy
  • 208
  • 1
  • 2
  • 7
15
votes
4 answers

Gtk3 replace child widget with another widget

I'm looking for a way to remove a widget from its parent (whatever that may be - a VBox, a Grid, ...) and add a substitute widget in its place. I found this answer, but I can't seem to make it work with Gtk3. Here's what I tried: from gi.repository…
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
15
votes
2 answers

How to have drag-and-drop and sorted GtkTreeView in GTK3?

I am porting liblarch, a library for handling directed acyclic graphs, from PyGTK (GTK2) to PyGObject introspection (GTK3). I ran into the problem with GtkTreeView. The app using liblarch needs to sort GtkTreeView by a column but in the same time,…
izidor
  • 4,068
  • 5
  • 33
  • 43
14
votes
2 answers

How to capture Enter key press in GtkEntry

I am trying to capture the Enter key when it is pressed in a GtkEntry. Most of the resources I have found suggest connecting to the activate signal, but the documentation for GtkEntry states (emphasis mine): Applications should not connect to it,…
Sean Bright
  • 118,630
  • 17
  • 138
  • 146
14
votes
1 answer

bwrap: execvp application: No such file or directory (GNOME Builder Flatpak)

When I try to run the GJS GNOME Example application from GNOME Builder 3.32.4 (Flatpak'ed), I get the error: bwrap: execvp : No such file or directory I tried "Clean" and "Rebuild" the project, but with no help. This only happens…
Bastian
  • 620
  • 5
  • 14
14
votes
2 answers

How can I get the default colors in GTK?

Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on…
JohnW
  • 505
  • 3
  • 14