pygobject

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

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

Issues in installing pygobject in MacOS

Issues in installing pygobject in MacOS Question: I am trying to install pygobject using pip, even with brew in MacOS, but now successful. I followed guides. If I use the official installation guide in https://pygobject.readthedocs.io/en/latest/getting_started.html, then I have gtk+3 installed, but when I try to import the library: python3 -c ‘import gi; gi.require_version("Gtk", "3.0"); print("ok")’ …

Total answers: 1

How to create a letter spacing attribute with pycairo?

How to create a letter spacing attribute with pycairo? Question: I’m using Pango + Cairo (through GObject) to render text with python3.7, and would like to set the letter spacing by creating an attribute and attaching that attribute to my pango layout. In the gnome documentation for pango, I can see that there should be …

Total answers: 1

AppIndicator3.Indicator: is there a way to hide/show it at runtime?

AppIndicator3.Indicator: is there a way to hide/show it at runtime? Question: I am trying to hide the `AppIndicator3.Indicator“ once is shown but so far all my tries have failed. So far I tried to just set the instance to None in the hope that the garbage collector would remove it and I tried to set …

Total answers: 2

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

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

Gtk has no attribute 'DIALOG_DESTROY_WITH_PARENT'

Gtk has no attribute 'DIALOG_DESTROY_WITH_PARENT' Question: I am trying to create a working dialog box in Python 2.7/GTK+ 3 (PyGObject). I found an online tutorial which offered the following code… md = Gtk.MessageDialog(window, Gtk.DIALOG_DESTROY_WITH_PARENT, Gtk.MESSAGE_INFO, Gtk.BUTTONS_CLOSE, msg) response = md.run() However, running this results in the error… AttributeError: ‘gi.repository.Gtk’ object has no attribute ‘DIALOG_DESTROY_WITH_PARENT’ I’m …

Total answers: 2

What is the python equivalent of g_log_set_handler when using GLib from python

What is the python equivalent of g_log_set_handler when using GLib from python Question: I want to set the log level in my python glib project. Therefore I am looking for the g_log_set_handler() equivalent when using GLib from python via gi.repository. But the expected GLib.log_set_handler function seems to be missing. Here is a sample output of …

Total answers: 2

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