class Window(QMainWindow): def __init__(self): super(Window, self).__init__() self.ui = MyWindow() self.ui.setupUi(self) self.show() self.ui.onLoad()
def main(): """ opencvを用いて取得したカメラの情報をgtkを用いて出力する """ Gtk.Settings.get_default().set_property("gtk-icon-theme-name", "Numix") Gtk.Settings.get_default().set_property("gtk-theme-name", "Mojave-light") #Gtk.Settings.get_default().set_property("gtk-theme-name", "Windows-10-Dark") #Gtk.Settings.get_default().set_property("gtk-theme-name", "win32") win = MyWindow() win.connect("destroy",Gtk.main_quit) win.show_all() Gtk.main()
def window(): app = QApplication(sys.argv) win = MyWindow() win.show() sys.exit(app.exec_())
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from window import MyWindow win = MyWindow() win.connect("destroy", Gtk.main_quit) win.show_all() Gtk.main()
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from window import MyWindow win = MyWindow() # 关闭的设置 win.connect("delete-event", Gtk.main_quit) # 显示窗体 win.show_all() Gtk.main()
def main(): app = PyQt5.QtWidgets.QApplication(sys.argv) window = MyWindow() sys.exit(app.exec_())
def build(self): Window.clearcolor = (1, 1, 1, 1) def on_text(instance, value): return value text_input = TextInput(text="") text_input.bind(text=on_text) button = MyButton("Assemble") button2 = MyButton("Help") window = MyWindow(video.get_names(), button.get_button(), button2.get_button(), text_input).make_window() def callback(instance): choices = window.get_choices() cwd3 = os.getcwd() path3 = os.path.join(cwd3, "Downloads/StarWarsSpecializer/filepath.txt") file = open(path3, "r+") path4 = file.read() path4 = path4[2:-2] if not text_input.text: popup = Popup( title='Error', content=Label(text='Please enter a name for your video.'), size_hint=(None, None), size=(600, 600)) popup.open() elif '.mp4' in text_input.text: popup = Popup( title='Error', content=Label( text= 'Please do not include \'.mp4\' in your video name.'), size_hint=(None, None), size=(700, 700)) popup.open() else: try: cwd2 = os.getcwd() path2 = os.path.join(cwd2, "Downloads/StarWarsSpecializer/cuts") video.assemble(path2, choices, path4 + '/' + text_input.text + '.mp4') except: popup = Popup( title='Error', content=Label( text= 'Error creating video file. \nYou may have selected a file ' 'instead \nof a folder in the previous window. \nIf this is ' 'not the case, please\ncheck the README to ensure you\nfollowed all ' 'the instructions.'), size_hint=(None, None), size=(700, 700)) popup.open() else: App.get_running_app().stop() def callback2(instance): popup = Popup( title='Help', content=Label( text= 'Please select the changes you would\nlike to include and give your\nvideo' ' a name.'), size_hint=(None, None), size=(600, 600)) popup.open() button.get_button().bind(on_press=callback) button2.get_button().bind(on_press=callback2) return window