Skip to content

Commit

Permalink
Merge pull request #29 from aschn/master
Browse files Browse the repository at this point in the history
Update docs to make the tutorials Django-compatible.
  • Loading branch information
freakboy3742 committed Apr 6, 2017
2 parents 187e6df + a3dab14 commit e531e75
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ specific settings can be specified using a platform key::
'toga-ios'
]
},
'django': {
'app_requires': [
'toga-django'
]
},
}
)

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial-0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Finally, we have to add the setuptools ``setup.py`` script:
from setuptools import setup, find_packages
setup(name='HelloWorld',
version = '0.1',
version = '0.1.0',
packages = find_packages(),
options = {
'app': {
Expand Down
32 changes: 17 additions & 15 deletions docs/tutorials/tutorial-1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,33 @@ of ``setup.py`` script:
}
)
And now you can update the application, using for example the Toga Hello World,
found at <https://toga.readthedocs.io/en/latest/tutorial/tutorial-0.html>:
And now you can update the application, using, for example, the Toga Hello World
found at <https://toga.readthedocs.io/en/latest/tutorial/tutorial-0.html>,
modified to be class-based:

.. code-block:: python
import toga
def button_handler(widget):
print("hello")
class HelloWorld(toga.App):
def build(app):
box = toga.Box()
def startup(self):
self.main_window = toga.MainWindow(self.name)
self.main_window.app = self
box = toga.Box()
button = toga.Button('Hello world', on_press=button_handler)
button.style.set(margin=50)
box.add(button)
button = toga.Button('Hello world', on_press=button_handler)
button.style.set(margin=50)
box.add(button)
return box
self.main_window.content = box
self.main_window.show()
def button_handler(widget):
print("hello")
if __name__ == '__main__':
app = toga.App('First App', 'org.pybee.helloworld', startup=build)
app.main_loop()
Create the iOS app
------------------
Expand Down

0 comments on commit e531e75

Please sign in to comment.