Python Forum
Gnome GUI with glade - Printable Version

+- Python Forum (
+-- Forum: Python Coding (
+--- Forum: GUI (
+--- Thread: Gnome GUI with glade (/thread-29465.html)

Gnome GUI with glade - ways - Sep-03-2020


I'm trying to get into Gnome GUI development. I've created a project in Builder and have a basic UI. My problem is getting access to the widgets created by a glade xml file.

> parent = self.get_active_window()

I can get the window. But how can I access the widgets in it?

import sys
import gi
import configparser

gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gio
from .window import BtproxipyGtkWindow

class Application(Gtk.Application):
    project_name = '*'
    config_path = None
    enabled = False
    debug = False

    def __init__(self):

        # self.config_path = appdirs.user_config_dir(self.project_name) + '.ini'
        self.config_path = '/home/user/.config/' + self.project_name + '/' + self.project_name + '.ini'

    def do_activate(self):
        win = self.props.active_window
        if not win:
            win = BtproxipyGtkWindow(application=self)

        parent = self.get_active_window()

def main(version):
    app = Application()