Blame platform-demos/C/samples/window.py
|
Packit |
1470ea |
from gi.repository import Gtk
|
|
Packit |
1470ea |
import sys
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
class MyApplication(Gtk.Application):
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
def do_activate(self):
|
|
Packit |
1470ea |
# create a Gtk Window belonging to the application itself
|
|
Packit |
1470ea |
window = Gtk.Window(application=self)
|
|
Packit |
1470ea |
# set the title
|
|
Packit |
1470ea |
window.set_title("Welcome to GNOME")
|
|
Packit |
1470ea |
# show the window
|
|
Packit |
1470ea |
window.show_all()
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
# create and run the application, exit with the value returned by
|
|
Packit |
1470ea |
# running the program
|
|
Packit |
1470ea |
app = MyApplication()
|
|
Packit |
1470ea |
exit_status = app.run(sys.argv)
|
|
Packit |
1470ea |
sys.exit(exit_status)
|