Skip to content
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

'MainWindow object has no attribute 'toolbar' #17

Closed
noodlebreak opened this issue Aug 6, 2014 · 4 comments
Closed

'MainWindow object has no attribute 'toolbar' #17

noodlebreak opened this issue Aug 6, 2014 · 4 comments

Comments

@noodlebreak
Copy link

Running the helloworld example in Ubuntu 14.04 with Python 2.7
Here's the code, exactly the same as in the docs:

from __future__ import print_function, unicode_literals, absolute_import

import toga

def button_handler(widget):
    print("hello")

if __name__ == '__main__':

    app = toga.App('First App', 'org.pybee.helloworld')

    container = toga.Container()

    button = toga.Button('Hello world', on_press=button_handler)

    container.add(button)

    container.constrain(button.TOP == container.TOP + 50)
    container.constrain(button.LEADING == container.LEADING + 50)
    container.constrain(button.TRAILING + 50 == container.TRAILING)
    container.constrain(button.BOTTOM + 50 < container.BOTTOM)

    app.main_window.content = container

    app.main_loop()

When I run it, I get these errors:

Traceback (most recent call last):
  File "/home/censored/.virtualenvs/toga/local/lib/python2.7/site-packages/toga/platform/gtk/app.py", line 27, in _startup
    self.main_window.app = self
  File "/home/censored/.virtualenvs/toga/local/lib/python2.7/site-packages/toga/platform/gtk/window.py", line 61, in app
    self._startup()
  File "/home/censored/.virtualenvs/toga/local/lib/python2.7/site-packages/toga/platform/gtk/window.py", line 24, in _startup
    if self.toolbar:
AttributeError: 'MainWindow' object has no attribute 'toolbar'
@noodlebreak noodlebreak changed the title Running the helloworld example in Ubuntu 14.04 with Python 2.7 'MainWindow object has no attribute 'toolbar' Aug 6, 2014
@freakboy3742
Copy link
Member

Thanks for the report - this is a duplicate of #1, which has been fixed in master.

@noodlebreak
Copy link
Author

Alrighty. Thanks.

@jgomo3
Copy link

jgomo3 commented Aug 9, 2014

Any plans to update the pypi version with this FIX?

@freakboy3742
Copy link
Member

Yes - I will release an updated version in the near future. I received a couple of other pieces of feedback after the initial release that I want to integrate first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants