Skip to content

typing: GObject: Allow for using Signal#214

Merged
lovetox merged 3 commits intopygobject:masterfrom
jamiethecat:signal-object
Apr 29, 2025
Merged

typing: GObject: Allow for using Signal#214
lovetox merged 3 commits intopygobject:masterfrom
jamiethecat:signal-object

Conversation

@jamiethecat
Copy link
Contributor

@jamiethecat jamiethecat commented Apr 24, 2025

The following code is also a valid way of connecting/emitting signals, just like strings.

from gi.repository import GObject


class Object(GObject.Object):
    signal = GObject.Signal()


object = Object()
object.connect(object.signal, lambda *_: print("Test"))
object.emit(object.signal)

@lovetox lovetox merged commit fa1413a into pygobject:master Apr 29, 2025
2 checks passed
@jamiethecat jamiethecat deleted the signal-object branch February 13, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants