Skip to content

Commit

Permalink
gobject-with-properties accepts a hash and returns the instance
Browse files Browse the repository at this point in the history
  • Loading branch information
mwunsch committed Jun 8, 2017
1 parent 90dddc5 commit 7ec07b0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ffi/unsafe/introspection.rkt
Expand Up @@ -67,6 +67,8 @@
(->* (gobject? string? any/c)
((or/c ctype? (listof symbol?)))
void?)]
[gobject-with-properties
(->> gobject? (hash/c symbol? any/c) gobject?)]
[introspection
(->* (symbol?) (string?) gi-repository?)]
[gi-repository-find-name
Expand Down Expand Up @@ -915,6 +917,11 @@
-> _void))])
(setter gobject propname value)))

(define (gobject-with-properties instance properties)
(hash-for-each properties
(lambda (key val) (gobject-set! instance (symbol->string key) val)))
instance)

(define-gir gi-object-parent (_fun _gi-base-info -> _gi-base-info)
#:c-id g_object_info_get_parent)

Expand Down

0 comments on commit 7ec07b0

Please sign in to comment.