New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding MultiviewTextInput results in TypeError #205

Closed
teletypist opened this Issue Jul 27, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@teletypist

teletypist commented Jul 27, 2017

I tried building a basic Toga app from the tutorial 0 example, but when I substitute the button with a multitextinput it crashes with a TypeError. I have attached code and the resulting terminal output.

Running OSX 10.12.5 with Python 3

installed through Homebrew. Python is executed inside virtual environment.

Thanks for any help.

Source code:

import sys

print("python version: {}".format(sys.version))
print("toga version: {}".format(toga.__version__))

def build(app):
    box = toga.Box()
    textbox = toga.MultilineTextInput("This is a textbox")
    box.add(textbox)
    return box

def main():
    return toga.App("My App", 'org.pybee.helloworld', startup=build)

if __name__ == '__main__':
    main().main_loop()

Output:

[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]
toga version: 0.2.12
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/frederick/Projects/scription/src/scription/example.py", line 17, in <module>
    main().main_loop()
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga_cocoa/app.py", line 137, in main_loop
    self._startup()
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga_cocoa/app.py", line 129, in _startup
    self.startup()
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga/interface/app.py", line 125, in startup
    self.main_window.content = self._startup_method(self)
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga/interface/window.py", line 144, in content
    widget._update_layout()
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga/interface/widgets/base.py", line 313, in _update_layout
    self._update_child_layout()
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga/interface/widgets/base.py", line 324, in _update_child_layout
    child._update_layout()
  File "/Users/frederick/Projects/scription/venv/lib/python3.6/site-packages/toga/interface/widgets/base.py", line 316, in _update_layout
    self._apply_layout()
TypeError: _apply_layout() missing 1 required positional argument: 'layout'```
@teletypist

This comment has been minimized.

teletypist commented Jul 27, 2017

Just found closed issue #187, I thought I was using the most recent pull from master but perhaps not.

@teletypist teletypist closed this Jul 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment