Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Librem5
squeekboard
Commits
2021311a
Commit
2021311a
authored
Mar 10, 2011
by
Daiki Ueno
Browse files
Add destroyed signal in python binding.
parent
b64e91df
Changes
2
Hide whitespace changes
Inline
Side-by-side
bindings/python/eekboard/context.py
View file @
2021311a
...
...
@@ -36,7 +36,15 @@ class Context(gobject.GObject):
'key-released'
:
(
gobject
.
SIGNAL_RUN_LAST
,
gobject
.
TYPE_NONE
,
(
gobject
.
TYPE_UINT
,))
(
gobject
.
TYPE_UINT
,)),
'destroyed'
:
(
gobject
.
SIGNAL_RUN_LAST
,
gobject
.
TYPE_NONE
,
()),
}
__gproperties__
=
{
'keyboard-visible'
:
(
bool
,
None
,
None
,
False
,
gobject
.
PARAM_READABLE
),
}
def
__init__
(
self
,
giobject
):
...
...
@@ -47,6 +55,7 @@ class Context(gobject.GObject):
self
.
__giobject
.
connect
(
'disabled'
,
lambda
*
args
:
self
.
emit
(
'disabled'
))
self
.
__giobject
.
connect
(
'key-pressed'
,
lambda
*
args
:
self
.
emit
(
'key-pressed'
,
args
[
1
]))
self
.
__giobject
.
connect
(
'key-released'
,
lambda
*
args
:
self
.
emit
(
'key-released'
,
args
[
1
]))
self
.
__giobject
.
connect
(
'destroyed'
,
lambda
*
args
:
self
.
emit
(
'destroyed'
))
def
get_giobject
(
self
):
return
self
.
__giobject
...
...
bindings/python/eekboard/eekboard.py
View file @
2021311a
...
...
@@ -22,11 +22,18 @@ from context import Context
class
Eekboard
(
gobject
.
GObject
):
__gtype_name__
=
"PYEekboardEekboard"
__gsignals__
=
{
'destroyed'
:
(
gobject
.
SIGNAL_RUN_LAST
,
gobject
.
TYPE_NONE
,
())
}
def
__init__
(
self
):
super
(
Eekboard
,
self
).
__init__
()
self
.
__connection
=
Gio
.
bus_get_sync
(
Gio
.
BusType
.
SESSION
,
None
)
self
.
__eekboard
=
gi
.
repository
.
Eekboard
.
Eekboard
.
new
(
self
.
__connection
,
None
);
self
.
__eekboard
.
connect
(
'destroyed'
,
lambda
*
args
:
self
.
emit
(
'destroyed'
))
def
create_context
(
self
,
client_name
):
context
=
self
.
__eekboard
.
create_context
(
client_name
,
None
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment