Created
November 22, 2016 10:52
-
-
Save freakboy3742/9cb2f5f0c32c095801ebb67d7171af3a to your computer and use it in GitHub Desktop.
Toga for Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import toga | |
def button_handler(widget): | |
print("Hello") | |
class Example(toga.App): | |
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) | |
self.main_window.title = self.name | |
self.main_window.content = box | |
# Show the main window | |
self.main_window.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import url | |
from django.contrib import admin | |
from example import Example | |
urlpatterns = [ | |
url(r'^admin/', admin.site.urls), | |
url(r'', Example('Example App 1.0', 'org.beeware.example').urls) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment