Skip to content

Commit

Permalink
address type issues
Browse files Browse the repository at this point in the history
This commit was sponsored by Devin Prater, VM (Vicky) Brasseur, Jason
Mills, and my other patrons.  If you want to join them, you can
support my work at https://glyph.im/patrons/.
  • Loading branch information
glyph committed Dec 12, 2024
1 parent d0bd1c9 commit b91aff3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
Empty file.
23 changes: 9 additions & 14 deletions src/pomodouroboros/linux/gtk_list_detail.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import gi # type:ignore

gi.require_version("GLib", "2.0")
from gi.repository import GLib # type:ignore
from gi.repository import Gio, GObject

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

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

from .platspec import GObject, Gtk, Gio

class MyThing(GObject.Object):
def __init__(self, aValue: int) -> None:
Expand Down Expand Up @@ -37,11 +27,15 @@ def on_activate(app: Gtk.Application) -> None:
def onsetup(
factory: Gtk.SignalListItemFactory, item: Gtk.ListItem
) -> None:
value = item.get_item().aValue
model = item.get_item()
assert isinstance(model, MyThing)
value = model.aValue
item.set_child(Gtk.Label.new(f"setup {value}"))

def onbind(factory: Gtk.SignalListItemFactory, item: Gtk.ListItem) -> None:
value = item.get_item().aValue
model = item.get_item()
assert isinstance(model, MyThing)
value = model.aValue
item.set_child(Gtk.Label.new(f"bind {value}"))

signalFactory.connect("setup", onsetup)
Expand All @@ -62,5 +56,6 @@ def onbind(factory: Gtk.SignalListItemFactory, item: Gtk.ListItem) -> None:

# Run the application
print("running?")
app.run()
from sys import argv
app.run(argv)
print("goodbye?")
12 changes: 11 additions & 1 deletion src/pomodouroboros/linux/platspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

gi.require_version("GLib", "2.0")
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gio


gi.require_version("Gdk", "4.0")
from gi.repository import Gdk
Expand All @@ -20,11 +23,18 @@
from Xlib.display import Display as XOpenDisplay
from ewmh import EWMH # type:ignore

from cairo import Region, RectangleInt
# sometimes cairo is installed for development, it carries its own types, but
# it also has a bunch of C code and C dependencies and we don't want to make it
# required for CI.

# mypy: no-warn-unused-ignores
from cairo import Region, RectangleInt # type:ignore


__all__ = [
"GObject",
"GLib",
"Gio",
"Gdk",
"Gtk",
"GdkX11",
Expand Down

0 comments on commit b91aff3

Please sign in to comment.