robotools / vanilla

A Pythonic wrapper around Cocoa.
MIT License
78 stars 28 forks source link

RadioGroup.getTitle() raises AttributeError #173

Closed BoldMonday closed 11 months ago

BoldMonday commented 2 years ago

Using this example from de Vanilla documentation:

from vanilla import Window, RadioGroup

class RadioGroupDemo:

    def __init__(self):
        self.w = Window((100, 60))
        self.w.radioGroup = RadioGroup((10, 10, -10, 40),
                                ["Option 1", "Option 2"],
                                callback=self.radioGroupCallback)
        self.w.radioGroup.set(0)
        self.w.open()

    def radioGroupCallback(self, sender):
        print(sender.getTitle())

RadioGroupDemo()

Raises the following error:

Traceback (most recent call last):
  File "/Applications/RoboFont-4.2.app/Contents/Resources/lib/python3.7/vanilla/vanillaBase.py", line 507, in action_
    self.callback(sender)
  File "<untitled>", line 15, in radioGroupCallback
  File "/Applications/RoboFont-4.2.app/Contents/Resources/lib/python3.7/vanilla/vanillaBase.py", line 338, in getTitle
    return self._nsObject.title()
AttributeError: 'VNSMatrix' object has no attribute 'title'
Traceback (most recent call last):
  File "lib/doodleDelegate.pyc", line 96, in sendEvent_
  File "/Applications/RoboFont-4.2.app/Contents/Resources/lib/python3.7/vanilla/vanillaBase.py", line 507, in action_
    self.callback(sender)
  File "<untitled>", line 15, in radioGroupCallback
  File "/Applications/RoboFont-4.2.app/Contents/Resources/lib/python3.7/vanilla/vanillaBase.py", line 338, in getTitle
    return self._nsObject.title()
AttributeError: 'VNSMatrix' object has no attribute 'title'
typesupply commented 11 months ago

It looks like this has been fixed.