خرید بک لینک

Vote count: 0

Using Glade to try and create a user interface. so far I have a main window and a sub window. I can click on a button on the toolbar of the main window to open an instance of the sub window class. I then have a button on the sub window that doesn't seem to be working

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


class InitialWindow:

def on_window1_destroy(self, object, data=None):
    print("quit with cancel")
    Gtk.main_quit()

def on_gtk_quit_activate(self, menuitem, data=None):
    print("quit from menu")
    Gtk.main_quit()

def on_toolbutton5_clicked(self, object, data=None):
    print("Getting stock check")
    StockCheck()

def __init__(self):
    self.gladefile = "test.glade"
    self.builder = Gtk.Builder()
    self.builder.add_from_file(self.gladefile)
    self.builder.coect_signals(self)
    self.initialwindow = self.builder.get_object("window1")
    self.initialwindow.show()
    self.initialwindow.maximize()


class StockCheck:

def __init__(self):
    self.gladefile = "test.glade"
    self.builder = Gtk.Builder()
    self.builder.add_from_file(self.gladefile)
    self.stockCheck = self.builder.get_object("stockCheck")
    self.stockCheck.show()

def on_button1_clicked(self, widget, data=None):
    print("worked")


if __name__ == "__main__":
    main = InitialWindow()

Gtk.main()

asked 51 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 16 شهريور 1395 ساعت: 18:51

صفحه بندی