-
-
Notifications
You must be signed in to change notification settings - Fork 484
Closed as not planned
Labels
awaiting detailsMore details are needed before the issue can be triaged.More details are needed before the issue can be triaged.bugA crash or error in behavior.A crash or error in behavior.
Description
Describe the bug
I can't run my code
Steps to reproduce
idk
Expected behavior
to run
Screenshots
No response
Environment
- Operating System:
- Python version:
- Software versions:
- Briefcase:
- Toga:
- ...
Logs
Additional context
here's my code:
import toga, faker
from toga.style.pack import COLUMN, ROW
class HelloWorld(toga.App):
def greeting(name):
if name:
return f"Hello, {name}"
else:
return "Hello, stranger"
def startup(self):
main_box = toga.Box(direction=COLUMN)
name_label = toga.Label(
"Your name: ",
margin=(0, 5),
)
self.name_input = toga.TextInput(flex=1)
name_box = toga.Box(direction=ROW, margin=5)
name_box.add(name_label)
name_box.add(self.name_input)
print(f"{self.name_input.value}")
button = toga.Button(
"Say Hello!",
on_press=self.say_hello,
margin=5,
)
main_box.add(name_box)
main_box.add(button)
self.main_window = toga.MainWindow(title=self.formal_name)
self.main_window.content = main_box
self.main_window.show()
async def say_hello(self, widget):
fake = faker.Faker()
await self.main_window.dialog(
toga.InfoDialog(
greeting(self.name_input.value),
f"A message from {fake.name()}: {fake.text()}",
)
)
def main():
return HelloWorld()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
awaiting detailsMore details are needed before the issue can be triaged.More details are needed before the issue can be triaged.bugA crash or error in behavior.A crash or error in behavior.