1. Ronald Oussoren
  2. pyobjc
  3. Issues

Issues

Issue #8 resolved

Bindings for NSDictionaryOfVariableBindings (10.7 API)

Ronald Oussoren
repo owner created an issue

NSDictionaryOfVariableBindings() is a macro that is passed a list variables and creates a dictionary that maps the name of the variable to the current value:

{{{ NSDictionaryOfVariableBindings(button1, button2, nil) -> {"button1": button1, "button2": button2} }}}

There cannot be a python binding for this API with exactly the same interface. I've currently documented that one should create the dictionary explicitly (which is easier to do in Python than ObjC).

It might be useful to add a function that is passed the variable names:

{{{ NSDictionaryOfVariableBindings("button1", "button2") -> { ... } }}}

This is easy to implement, but I'm not yet sure if doing that would be useful or would just result in confused users.

Comments (1)

  1. Ronald Oussoren reporter

    Add implementation of NSDictionaryOfVariableBindings

    This adds a trivial implementation of NSDictionaryOfVariableBindings. The difference with ObjC is that the arguments are strings, not identifiers. The latter cannot be implemented in Python.

    Fixes issue #8

    f4e922ca0f41

  2. Log in to comment