Closed selasley closed 7 years ago
Thanks for the report. Your change to toolbar.add()
is clearly correct, which is an oversight on my part. The subsequent error appears to be an issue with Rubicon; can you confirm the version of Rubicon that is installed?
pip list shows rubicon-objc 0.2.7
I added some lines to print the type and dir of filename
<class 'rubicon.objc.objc.ObjCInstance'>
['class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattr', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_asparameter', '_cached_objects', 'objc_class', 'ptr']
using latest git head of toga-demo and changing the line per @selasley
I get this:
Traceback (most recent call last):
File "/usr/local/bin//toga-demo", line 11, in
versions from pip3 list: toga (0.2.14) toga-cocoa (0.2.14) toga-core (0.2.14) toga-demo (0.2.13, ~/src/toga-demo)
I tried running the toga-demo 0.2.14 with python3.6.2 under OS X 10.12.6 and got this traceback
Traceback (most recent call last): File "toga214/bin/toga-demo", line 11, in
sys.exit(run())
File "/Users/selasley/toga214/lib/python3.6/site-packages/toga_demo/main.py", line 5, in run
main().main_loop()
File "/Users/selasley/toga214/lib/python3.6/site-packages/toga_cocoa/app.py", line 167, in main_loop
self._startup()
File "/Users/selasley/toga214/lib/python3.6/site-packages/toga_cocoa/app.py", line 118, in _startup
self.startup()
File "/Users/selasley/toga214/lib/python3.6/site-packages/toga_demo/app.py", line 55, in startup
self.main_window.toolbar = [cmd1, toga.SEPARATOR, cmd2]
AttributeError: module 'toga' has no attribute 'SEPARATOR'
The demo runs and buttons and menus work after changing line 55 in toga_demo/app.py from self.main_window.toolbar = [cmd1, toga.SEPARATOR, cmd2] to self.main_window.toolbar.add(cmd1, cmd2)
but it displays this traceback in the Terminal
Traceback (most recent call last): File "_ctypes/callbacks.c", line 234, in 'calling callback function' File "/Users/selasley/toga214/lib/python3.6/site-packages/rubicon/objc/objc.py", line 1050, in _objc_method result = f(py_self, *args) File "/Users/selasley/toga214/lib/python3.6/site-packages/toga_cocoa/app.py", line 55, in applicationopenFiles for i in range(0, len(filenames)): TypeError: object of type 'ObjCInstance' has no len()
This traceback is also displayed for the scripts in the toga tutorial.
Thanks for creating toga and the whole BeeWare project.