0

This attribute error appeared when I try to run my code using Gtk and Python. Would anyone know how to solve it? This is my code:

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

builder = Gtk.Builder()
builder.add_from_file('user_interface.glade')

class Manipulador(object):
    def __init__(self):
        self.entry = builder.get_object('entry')
        self.label = builder.get_object('label')

    def on_button_clicked(self, button):
        text = self.entry.get_text()
        self.label.set_text(text)

    def on_main_window_destroy(self, window):
        Gtk.main_quit()

builder.connect_signals(Manipulador())
window = builder.get_object()
window.show_all()
Gtk.main()
BobMorane
  • 3,870
  • 3
  • 20
  • 42
  • [solved] I solved it by reinstalling GTK in the ming64 shell – Chris Berenguer May 07 '22 at 20:14
  • Welcome to Stack Overflow! If you've found the answer to a question, please write and [accept](https://stackoverflow.com/help/accepted-answer) an answer, so that other users know that the question has been answered satisfactorily. See [answer] for more information. – Sylvester Kruin May 07 '22 at 23:48

0 Answers0