File: simple_example.py

package info (click to toggle)
pygobject 3.54.5-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,864 kB
  • sloc: ansic: 40,281; python: 26,363; sh: 477; makefile: 81; xml: 35; cpp: 1
file content (18 lines) | stat: -rw-r--r-- 344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gi

gi.require_version("Gtk", "4.0")
from gi.repository import Gtk


def on_activate(app):
    # Create window
    win = Gtk.ApplicationWindow(application=app)
    win.present()


# Create a new application
app = Gtk.Application(application_id="com.example.App")
app.connect("activate", on_activate)

# Run the application
app.run(None)