gtk

Change the Background color of a Gtk Toglebutton in Python

Change the Background color of a Gtk Toglebutton in Python Question: I’ve been looking for a few days for information on how to change the colour of widgets in Python/Gtk 3 but haven’t found much. What I specifically want to do is change the colour of ToggleButtons in CSS. The Gtk documentation is not help …

Total answers: 1

CSS styling for Gtk Widgets not working (Python, Gtk4?

CSS styling for Gtk Widgets not working (Python, Gtk4)? Question: In my app I want some kind of profile picture a user can have. At first wanted to use libadwaita’s Avatar widget, but it cannot load images from a file, which is a feature that I need. So I thought I would just implement a …

Total answers: 1

Python 3 + GTK 4 – Buttons with pictures and labels look weird

Python 3 + GTK 4 – Buttons with pictures and labels look weird Question: 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 …

Total answers: 1

package Adw doesn't have EntryRow

package Adw doesn't have EntryRow Question: I’m trying to make a boxed-list with an AdwEntryRow, following: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/boxed-lists.html#boxed-lists However I don’t find this class in Adw (Pdb) Adw <IntrospectionModule ‘Adw’ from ‘/usr/lib64/girepository-1.0/Adw-1.typelib’> (Pdb) [x for x in dir(Adw) if "Row" in x] [‘ActionRow’, ‘ActionRowClass’, ‘ComboRow’, ‘ComboRowClass’, ‘ExpanderRow’, ‘ExpanderRowClass’, ‘PreferencesRow’, ‘PreferencesRowClass’] these are my dependencies so far: …

Total answers: 1

How can I store integers wider than 32 bits in a Gtk.ListStore?

How can I store integers wider than 32 bits in a Gtk.ListStore? Question: It seems that DirEntry‘s f.stat().st_size can return values larger than 2147483647 for the file size, which – in my case – is correct. But when I try to store it in a Gtk.ListStore which has the corresponding column set to int, I …

Total answers: 1

Preventing multiple instances of a thread in GTK

Preventing multiple instances of a thread in GTK Question: Upon pressing a listbox row, a thread is started which: Clears the treeview (its liststore) Then, adds items to the treeview (or rather its liststore). The row can be pressed multiple times, meaning it can spawn multiple threads, which may end up running simultaneously. The issue …

Total answers: 2

Implementing threading in a Python GTK application (PyGObject) to prevent UI freezing

Implementing threading in a Python GTK application (PyGObject) to prevent UI freezing Question: Simply put, I want to properly implement threading in a Python GTK application. This is in order to prevent UI freezing due to functions/code taking a long time to finish running. Hence, my approach was to move all code which took a …

Total answers: 1

Qt5 application not terminating on QMainWindow.close() after opening QFileDialog

Qt5 application not terminating on QMainWindow.close() after opening QFileDialog Question: I have a not very sophisticated but also not trivial Qt5 python application (the full thing is here: https://gitlab.com/rulrich/pydatagrab but see below for a minimal example) My question is the following: I have a QMainWindow where in the constructor I do many things, but also: …

Total answers: 1

CSS styles are not being applied on a Gtk widget

CSS styles are not being applied on a Gtk widget Question: Another user here on StackOverflow has some problems styling his Gtk application with CSS. I found a solution for part of the problems, but for one I don’t know anything. The original post is with C code, but the following Python Minimal Reproducible Example …

Total answers: 1

GtkAboutDialog not working when press two times

GtkAboutDialog not working when press two times Question: I am starting GtkAboutDialog from a menubar item. This is the function toggling the dialog: def open_about(self, *args): x = about.run() if x == -4: # When pressing close; about.destroy() If I click the menubar about item once, there is no problem, dialog opens and I can …

Total answers: 1