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
2 answers

Python - gtk3 add stock icons to Gtk.Buttons

I'm new to GTK3 (I prefer wxWidgets), and I can't load a stock icon to a gtk.button... This is my attempt: image = Gtk.Image() pb = Pixbuf.new_from_stock(Gtk.STOCK_OPEN) self.browse_button =…
Hairo
  • 2,062
  • 5
  • 27
  • 33
7
votes
1 answer

Webkit threads with PyGObject on Gtk3

I am trying to load a webkit view on a different thread than main thread for gtk. I see the example PyGTK, Threads and WebKit I slightly modify for support PyGObject and GTK3: from gi.repository import Gtk from gi.repository import Gdk from…
shakaran
  • 10,612
  • 2
  • 29
  • 46
7
votes
2 answers

Destructing Glib::RefPtr causes failed assertions in the GTK 3 core

The guys from Gtkmm are comparing Glib::RefPtr with std::auto_ptr<>: Glib::RefPtr is a smartpointer. Specifically, it is a reference-counting smartpointer. You might be familiar with std::auto_ptr<>, which is also a smartpointer, but Glib::RefPtr<>…
glitto
  • 166
  • 7
6
votes
4 answers

How to draw a line in a GtkDrawingArea using Cairo with Gtk3

Could someone please show me a minimal working example of using C language for Cairo with Gtk3 to draw a single line in a GtkDrawingArea. I've tried to modify testcairo.c in the Gtk3 tests folder but I can't get it to work. Please don't suggest the…
mike
  • 1,135
  • 4
  • 22
  • 39
6
votes
1 answer

Python. Doing some work on background with Gtk GUI

python 3.2.2 gtk3 3.2.2 python-gobject 3.0.2 I'm trying to display a GUI and do some work in the background. As I understand it should look something like this: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import time from threading import…
Atterratio
  • 445
  • 2
  • 9
  • 25
6
votes
1 answer

GTK - Python Window Symbolic Icon Color Problem

I have a GTK3 GUI called by a simple Python 3 code. Icon is located in the /usr/share/icons/hicolor/scalable/actions/ directory. My current theme color is dark and icons look white. When I switch to white system theme GUI icons turn into black. But…
6
votes
1 answer

gtk-rs: how to update view from another thread

I am creating a UI application with gtk-rs. In that application, I have to spawn a thread to continuously communicate with another process. Sometimes, I have to update the UI based on what happens in that thread. But, I'm not sure how to do this…
QuinnFreedman
  • 2,242
  • 2
  • 25
  • 42
6
votes
2 answers

Scroll to selected row in GtkListBox

I'm a bit out of ideas here. I want a very simple thing: to be able to select a given GtkListBox row programmatically and then scroll the list box (which is wrapped in a ScrolledWindow and a Viewport). Selecting a row is trivial (my code is Go &…
yktoo
  • 2,696
  • 1
  • 23
  • 35
6
votes
0 answers

Create a menubar for GTK 2.24 and GTK 3 and GTK 4

GTK 4 will remove GtkMenu, GtkMenuBar and GtkMenuItem. Why not, but, is there a common way to create a classic menubar for GTK 2.24 and GTK 3 and GTK 4 in C? An example:
luigifab
  • 384
  • 3
  • 19
6
votes
1 answer

Theme and Icons Problem with GTK3 Installed with vcpkg

I am using Visual Studio 2019 on Windows 10 and am trying to use GTK in C++ and installed it using vcpkg. I've installed GTK using vcpkg according to the guide from GTK. I'm using Visual Studio 2019 and it is able to compile and run the example…
ufoxDan
  • 609
  • 4
  • 13
6
votes
1 answer

Styling all GtkEntry widgets with CSS using Python3 PyGObject

I'm developing a GUI with PyGObject and am trying to style all the entry widgets. From this post I get the impression that I should be able to create a CSS style that would apply to all GtkEntry objects, but for some reason it's not working for me…
lefthander
  • 163
  • 1
  • 4
6
votes
2 answers

GTK+ 3 native file chooser - allowed file types and default file name

I am using GTK+ to create a C++ program. For choosing files I used native file chooser as the gtk file chooser has a memory leak. Here is my question: How can I set a default file name for the native file chooser in GTK+ (while saving) and how can I…
PaweX3
  • 65
  • 1
  • 7
6
votes
0 answers

Installing Perl 6 to MSYS2 on Windows 10

I want to develop a GTK+3 app on Windows 10 using Perl 6 and its NativeCall library. I have installed MSYS2 and GTK+3 on it and could run an example GTK+3 C program using it. But I couldn't install Perl 6 on MSYS2. I have tried to search web for…
ismailarilik
  • 2,236
  • 2
  • 26
  • 37
6
votes
1 answer

Where to get precompiled GTK3 for windows?

Is there any place where I can download precompiled GTK3 for windows? The GTK site only provides binaries for the 2.22 version.
Lothar
  • 12,537
  • 6
  • 72
  • 121
6
votes
1 answer

Cancel a Drag & Drop for some specific items in a Gtk.TreeView

I have a Gtk.TreeView here. Most but not all of the items should be able to be dragged & dropped. In this example the first item should not be able to be dragged & dropped but it should be selectable. How can I realize this? Maybe I have to use the…
buhtz
  • 10,774
  • 18
  • 76
  • 149