Python Forum
Gnome GUI with glade
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gnome GUI with glade
#1
Hi

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.

With
> 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):
        super().__init__(application_id='org.example.App',
                         flags=Gio.ApplicationFlags.FLAGS_NONE)

        # 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)
        win.present()

        parent = self.get_active_window()

def main(version):
    app = Application()
    return app.run(sys.argv)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [GI] Error when I close the interface Glade/GTK3/ Charles25 2 2,113 Jun-16-2020, 07:02 PM
Last Post: Charles25

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020