gtk3

Python Gtk3 Filechooser doesn't close after selection

Python Gtk3 Filechooser doesn't close after selection Question: I am working on a python application with a Gtk3 interface and have encountered an issue that I would like some help with. A button click signal runs an ‘on_clicked’ function which in turn calls a ‘filechooser’ function. The filechooser function displays a Gtk.FileChooserDialog to select a …

Total answers: 1

missing dependency after running pyinstaller

missing dependency after running pyinstaller Question: I have a large application that was developed in pycharm IDE. From the IDE it can be debugged and run. The application can also (and is typically) launched from a terminal command line and run that way. I need this application to be an executable, and I can successfully …

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

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

How to set the text size of Gtk.Entry in PyGObject?

How to set the text size of Gtk.Entry in PyGObject? Question: I want increase the text size of Gtk.Entry . entry = Gtk.Entry() I am using Python3 Asked By: Sanjay Prajapat || Source Answers: You can use Gtk.Entry.modify_font() to increase the size of the font. Here is an MCVE: import gi gi.require_version(‘Gtk’, ‘3.0’) from gi.repository …

Total answers: 2

select certain monitor for going fullscreen with gtk

select certain monitor for going fullscreen with gtk Question: I intend to change the monitor where I show a fullscreen window. This is especially interesting when having a projector hooked up. I’ve tried to use fullscreen_on_monitor but that doesn’t produce any visible changes. Here is a non-working example: #!/usr/bin/env python import sys import gi gi.require_version(‘Gtk’, …

Total answers: 2

PyGObject: Gtk.Fixed Z-order

PyGObject: Gtk.Fixed Z-order Question: I’m using Gtk.Fixed and a viewport putting images that, sometimes, overlaps. How can I set the z-index like in html? Asked By: David Davó || Source Answers: Gtk.Fixed doesn’t support setting the z-order. It’s not meant for overlapping widgets, so the z-order is arbitrary and probably depends on what order the …

Total answers: 3

How to adjust the size of a GtkGrid cell?

How to adjust the size of a GtkGrid cell? Question: I’m programming a little application in Python + Gtk3. I’m using a GtkGrid with one column and two rows. In the first row I put: a GtkScrolledWindow, and inside it a TreeView with two columns. In the second row I put: a ButtonBox, and inside …

Total answers: 1

Is there a gi.repository documentation for python?

Is there a gi.repository documentation for python? Question: I’m looking for a gi.repository module documentation and I can’t find anything on the internet. All I found is documentation of new Gtk3 libraries for C, or old PyGtk 2.0 Reference Manual I’m looking for something like PyGtk 2.0 Reference Manual but for Gtk3. Is there something …

Total answers: 5