24 lines
477 B
Python
24 lines
477 B
Python
import gi
|
|
|
|
gi.require_version("Gtk", "3.0")
|
|
from gi.repository import Gtk
|
|
|
|
|
|
class MyWindow(Gtk.Window):
|
|
def __init__(self):
|
|
super().__init__(title="Hello World")
|
|
|
|
self.button = Gtk.Button(label="Click me...")
|
|
self.button.connect("clicked", self.on_button_clicked)
|
|
self.add(self.button)
|
|
|
|
def on_button_clicked(self, widget):
|
|
print("Hello World")
|
|
|
|
|
|
win = MyWindow()
|
|
win.connect("destroy", Gtk.main_quit)
|
|
win.show_all()
|
|
Gtk.main()
|
|
|