Questions tagged [gtk4]
194 questions
1
vote
1 answer
Python 3 + GTK 4 - Buttons with pictures and labels look weird
I develop a simple app for Linux, Kamarada Firstboot (source on GitLab), using Python 3 and GTK, and I'm migrating from GTK 3 to GTK 4. In case you are curious, you can see it in action if you download the Linux Kamarada ISO image and boot it using…

Antônio Medeiros
- 3,068
- 1
- 27
- 22
1
vote
1 answer
New Gtk4 App. model : CLI positional arguments
I'm trying to understand how to define CLI arguments using the new Gtk4 model but I only managed to define non-positional / flagged arguments:
# (...)
class MyApp(Adw.Application):
def __init__(self, *args, **kwargs):
super().__init__(
…

yPhil
- 8,049
- 4
- 57
- 83
1
vote
0 answers
Scrolling and zooming GtkDrawingArea with GtkScrolledWindow consumes a lot of memory and causes the application to crash
Is it possible to zoom (scale) the content of GtkDrawingArea and scroll it with GtkScrolledWindow without changing the drawing area size? My strategy was to use ViewPort and manually adjust the upper horizontal and vertical adjustments to match the…

kkemic
- 59
- 3
1
vote
0 answers
GTK compilation on mac returns several errors
I have been trying to get started on GTK for Mac. I followed the installation steps and ran the hello-world program. I keep getting this error with gcc, though. Running
gcc $(pkg-config --cflags gtk4) -o hello-world-gtk hello-world-gtk.c…

Infection Tag
- 61
- 6
1
vote
1 answer
Python Gtk4 button with image and label
I am trying to create a Button in Gtk4.0 and the button should have an Icon and a Label.
But when I set the Label, the image will be deleted, and when i set the image (via btn.set_icon_name) then the label will be deleted.
After a bit of research, i…

Heschy
- 31
- 5
1
vote
0 answers
Gtk.ApplicationWindow cannot be a Parent
While porting my App (with modal dialogs) from Gtk(3.0) to Gtk(4.0) I found out that I want to use a Gtk.ApplicationWindow instead of a Gtk.Window. But now the Dialogs are not modal/they do not accept my Gtk.ApplicationWindow as Parent.
As I know…

Heschy
- 31
- 5
1
vote
0 answers
How to create this flowing layout in GTK?
I want to do like this:
Required properties:
There are columns forming straight lines from window's top edge, to window's bottom edge.
However, there are no rows, as each widget in a column is allowed to be packed without being constrained to fit…

caveman
- 422
- 3
- 17
1
vote
1 answer
How to use GTK4 without using the `Application` class?
Note how this application implements a mainloop by the activate signal and .run() method call:
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk
def on_activate(app):
win = Gtk.ApplicationWindow(application=app)
btn =…

caveman
- 422
- 3
- 17
1
vote
1 answer
How to render MPV to GTK4 window on X11 with python?
How can mpv render to GTK4 window or widget?
In GTK3 it was quite easy to get XID (and put it as argument to MPV) but in GTK4 It seem have to be done with GtkX11 and X11Surface https://docs.gtk.org/gdk4-x11/method.X11Surface.get_xid.html
But I have…

d3im
- 323
- 2
- 4
- 18
1
vote
0 answers
How to make child window on top in GTK4
I want to create a child window, bind it with its parent and make it on top and center of the main window, like the usual about dialog. However, I still got two separate windows like this:
Here is the demo's code:
use adw::prelude::*;
use…

Lomírus
- 29
- 5
1
vote
1 answer
Gtk4 PyGobject: Trying to snapshot GtkBox without a current allocation
I am developing an app with GTK4 + Python3 and I get this message:
Trying to snapshot GtkBox 0x5594bdcaa310 without a current allocation
It happens when I load a long list of ListBoxItems with an image in each of them. Seems kinda random, and only…

mijorus
- 111
- 1
- 7
1
vote
1 answer
Why GTK4 seems to use only 48x48 icons for displaying minimized application in all context?
In GTK4 the icon system for displaying the apps have changed.
In GTK3/GTK2 we could use simple commands like gtk_window_set_icon() or gtk_window_set_default_icon_from_file() or gtk_window_set_icon_list().
In GTK4 these commands are gone and we have…

Nils Beaussé
- 53
- 5
1
vote
2 answers
GTK 4 and applications icons : how to include an application icon in a portable way?
I have difficulties to understand the icon system in GTK 4 (I work in C language).
In GTK 2 and 3 that was easy to instruct the OS about the icon to use for displaying the apps.
In GTK 4 the set_icon functions have been removed which let us with the…

Nils Beaussé
- 53
- 5
1
vote
1 answer
GTK4 progress bar is not updating
have problem with GTK4 app written in C - progress bar value is not updated.
In apps window for first I show some data loaded from xml. After confirmation this screen I hide vBox with data and create
new one with progress bar which I want actualize…

fik236
- 83
- 6
1
vote
0 answers
Application name appears broken in GNOME title bar
I am trying to write applications with PyGObject. I have set the app name using GLib but it seems to be broken. There is no problem with other system programs that use Turkish characters in their titles.
import sys
import…

Alperen İsa
- 118
- 7