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

Packaging ruby gtk app

What is the least headache technique to package a gtk2/gtk3 app built with ruby for distribution as an executable, for windows, linux, macos? I could not find any guides or helpers to resolve this for ruby gtk. Nor the ruby-gnome gem comes with a…
arjun
  • 1,594
  • 16
  • 33
6
votes
0 answers

Change background color of Gtk Treeview rows - Python Gtk Gtk.CellRendererText

The color can be set on creation: cell.set_property("background", "orange") But how can I access the cell widgets later? What I try to do: Check if a value is valid and then color the cell green, else red. I found no way to change the style with…
oxidworks
  • 1,563
  • 1
  • 14
  • 37
6
votes
1 answer

How to use `pkg-config gtkmm-3.0 --cflags --libs` in the Visual Studio Code

How can I configure the tasks.json file so that when I press Ctrl + Shift + B the copier will use pkg-config gtkmm-3.0 --cflags --libs. My file looks like this: "version": "0.1.0", "command": "g++ `pkg-config gtkmm-3.0 --cflags…
Matheus Toniolli
  • 438
  • 1
  • 7
  • 16
6
votes
2 answers

How do I handle keyboard events in GTK+3?

What signals/functions should I use to get keyboard input in GTK+3? I have looked around and the only tutorials I know of that cover GTK+3 (zetcode and gnome developer) don't seem to cover that. Anyone can point me in the right direction?
PintoDoido
  • 1,011
  • 16
  • 35
6
votes
3 answers

GTK How to set font for a text_view

How can I set the font name and size for a text_view? Or do I have to set the font information at the buffer or at the window? Do I have to create some sort of style-sheet? #include int main(int argc, char *argv[]) { GtkWidget…
Graeme Jensz
  • 267
  • 4
  • 16
6
votes
1 answer

How to set size of a Gtk Image in Python

How can I set the width and height of a GTK Image in Python 3.
jojemapa
  • 873
  • 2
  • 10
  • 21
6
votes
1 answer

How to change Background color of child in GTK3 (c language) with CSS

Like the Title says I'm developing an App and I need to set the Background of all 4 child, but I have no clue how to do it. Here is an Example which explains how the App looks like: I need to change the backgrounds like this: One - should be…
Michi
  • 5,175
  • 7
  • 33
  • 58
6
votes
1 answer

GtkOverlay not passing through input events

The GtkOverlay widget has a special set_overlay_pass_through method to pass inputs through to underlying overlays. I want to use this feature to overlay a GtkDrawingArea over the UI to add drawings. Unfortunately, it does not work for me, no input…
tly
  • 1,202
  • 14
  • 17
6
votes
2 answers

'gtk/gtk.h' file not found Even with pkg-config

I'm creating a software in C using the SDL library and GTK+3. My first attempt with GTK+3 on a specific main.c and its Makefile works well, but when I try to add my GTK project to the other piece of code using my "real" Makefile, even if I added the…
zarak
  • 663
  • 1
  • 6
  • 16
6
votes
1 answer

Best way to set Entry Background Color in Python GTK3 and set back to default

What is the best way to set background color for one entry and set it back to the default color? My script is now working but I am very sure this is not the best way. Also I still have two problems: If I insert a text, not containing string "red"…
oxidworks
  • 1,563
  • 1
  • 14
  • 37
6
votes
2 answers

How to handle clicks on Links in Python with Gtk 3.0 and WebKit2 4.0?

I have created my view (wrapped in a window) and loaded an URL like this: self.web_view = WebKit2.WebView() self.web_view.load_uri("https://en.wikipedia.org") My "Mini-Browser" starts and I can click on local links (links which are bound to…
Witek
  • 6,160
  • 7
  • 43
  • 63
6
votes
1 answer

Python 3 & GTK3: crossplatform tray icon

It's possible to create a tray icon with a menu using AppIndicator3. But this solution is not portable. For instance it doesn't work on FreeBSD since there is no libappindicator3 on this system. I suspect that such code doesn't work on Windows and…
Aleksander Alekseev
  • 1,854
  • 4
  • 25
  • 57
6
votes
1 answer

How can I assign X11 native (or SDL) window as a parent for a GTK dialog?

I have a project using GTK+ 3 only for certain tasks, for example to provide file open dialog with gtk_file_chooser_dialog_new. I have to set parent to NULL as I have no "main" GTK window. However it's quite annoying that stdout of my program is…
6
votes
1 answer

Alpha transparency in Cairo

I have a problem with displaying alpha transparency using GTK and Cairo. I try to display this image 1 If I do the alpha blending my self, everything works. If I pass the alpha values directly to Cairo, the shadow seems to render fine, but the…
user877329
  • 6,717
  • 8
  • 46
  • 88
6
votes
1 answer

Python Gtk3 controlling button size

The button size should be controlled by packing HBox in VBox but my two buttons still have size depending on text: first=Gtk.VBox() second=Gtk.HBox() third=Gtk.VBox() fourth=Gtk.HBox() but1=Gtk.Button(label="any title") …
mpruchni
  • 290
  • 5
  • 17