Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
pygobject
pygobject
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 239
    • Issues 239
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • pygobjectpygobject
  • Issues
  • #138

Closed
Open
Opened Jul 16, 2017 by bugzilla-migration@bugzilla-migrationReporter

Support Child Properties

Submitted by Dan Yeaw

Link to original bug (#784991)

Description

Bug 338098 added support for defining object properties using GObject.Property. In pygtk I was creating child properties using a dictionary, for example:

__gchild_properties__ = {
    'weight': (GObject.TYPE_FLOAT,
               'item weight',
               'item weight',
               0,  # min
               1,  # max
               .2,  # default
               GObject.ParamFlags.READWRITE
              ),
}

and then:

for index, (name, pspec) in enumerate(six.iteritems(DockPaned.__gchild_properties__)):
    pspec = list(pspec)
    pspec.insert(0, name)
    Gtk.ContainerClass.install_child_property(DockPaned, index + 1, tuple(pspec))

Unfortunately with PyGObject this gives a TypeError: argument pspec: Expected GObject.ParamSpec, but got tuple

There needs to be a way to create child properties through install_child_property. What if we defined these properties using a new GObject.ChildProperty solution similar to what was added for other normal properties?

Edited Jan 18, 2018 by Christoph Reiter
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/pygobject#138