We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
RuntimeError in toga-demo
**Describe the bug**
when you run the toga-demo app and click on "Action 2" and then either Yes or No at the dialog, you get ```RuntimeError: Can't check dialog result directly; use await or an on_result handler``` printed on the console and no followup dialog.

**To Reproduce**
Steps to reproduce the behavior:
1. Install toga-core, toga-gtk, toga and demo using `pip install -e`
2. Run toga-demo
3. Click on Action 2
4. Click on either Yes or No in popup dialog
5. Note it logs a RuntimeError in the terminal you ran it from.

**Expected behavior**
Should not throw an error and instead it should pop up an enthusiastic response dialog.

**Screenshots**
```
Traceback (most recent call last):
  File "/home/nick/Work/beeware/toga/src/core/toga/handlers.py", line 66, in _handler
    result = handler(interface, *args, **kwargs)
  File "/home/nick/Work/beeware/toga/src/core/toga/handlers.py", line 66, in _handler
    result = handler(interface, *args, **kwargs)
  File "/home/nick/Work/beeware/toga/demo/toga_demo/app.py", line 91, in action2
    if self.main_window.question_dialog('Toga', 'Is this cool or what?'):
  File "/home/nick/Work/beeware/toga/src/gtk/toga_gtk/dialogs.py", line 16, in __bool__
    raise RuntimeError("Can't check dialog result directly; use await or an on_result handler")
RuntimeError: Can't check dialog result directly; use await or an on_result handler
```

If applicable, add screenshots to help explain your problem.

**Environment:**
 - Operating System: Ubuntu 20.04.4
 - Python version: 3.8.10
 - Software versions:
   - Toga: 0.3.0.dev34 400b6935c4689bedb134324b38eb1286af5b5ec6
   
**Suggested Fix**
It works if you make the `action2` function async, and make it await the question_dialog.
I'll submit an extremely trivial PR for this soon :-)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `demo/toga_demo/app.py`
Content:
```
1 import toga
2 from toga.constants import COLUMN
3 from toga.style import Pack
4 
5 
6 class TogaDemo(toga.App):
7 
8     def startup(self):
9         # Create the main window
10         self.main_window = toga.MainWindow(self.name)
11 
12         left_container = toga.OptionContainer()
13 
14         left_table = toga.Table(
15             headings=['Hello', 'World'],
16             data=[
17                 ('root1', 'value1'),
18                 ('root2', 'value2'),
19                 ('root3', 'value3'),
20                 ('root4', 'value4'),
21             ]
22         )
23 
24         left_tree = toga.Tree(
25             headings=['Navigate'],
26             data={
27                 ('root1',): {
28                 },
29                 ('root2',): {
30                     ('root2.1',): None,
31                     ('root2.2',): [
32                         ('root2.2.1',),
33                         ('root2.2.2',),
34                         ('root2.2.3',),
35                     ]
36                 }
37             }
38         )
39 
40         left_container.add('Table', left_table)
41         left_container.add('Tree', left_tree)
42 
43         right_content = toga.Box(style=Pack(direction=COLUMN))
44         for b in range(0, 10):
45             right_content.add(
46                 toga.Button(
47                     'Hello world %s' % b,
48                     on_press=self.button_handler,
49                     style=Pack(padding=20)
50                 )
51             )
52 
53         right_container = toga.ScrollContainer()
54 
55         right_container.content = right_content
56 
57         split = toga.SplitContainer()
58 
59         split.content = [left_container, right_container]
60 
61         cmd1 = toga.Command(
62             self.action1,
63             'Action 1',
64             tooltip='Perform action 1',
65             icon='resources/brutus',
66         )
67         cmd2 = toga.Command(
68             self.action2,
69             'Action 2',
70             tooltip='Perform action 2',
71             icon=toga.Icon.TOGA_ICON
72         )
73 
74         self.main_window.toolbar.add(cmd1, cmd2)
75 
76         self.main_window.content = split
77 
78         # Show the main window
79         self.main_window.show()
80 
81     def button_handler(self, widget):
82         print("button press")
83         for i in range(0, 10):
84             yield 1
85             print('still running... (iteration %s)' % i)
86 
87     def action1(self, widget):
88         self.main_window.info_dialog('Toga', 'THIS! IS! TOGA!!')
89 
90     def action2(self, widget):
91         if self.main_window.question_dialog('Toga', 'Is this cool or what?'):
92             self.main_window.info_dialog('Happiness', 'I know, right! :-)')
93         else:
94             self.main_window.info_dialog('Shucks...', "Well aren't you a spoilsport... :-(")
95 
96 
97 def main():
98     return TogaDemo('Toga Demo', 'org.beeware.toga-demo')
99
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/demo/toga_demo/app.py b/demo/toga_demo/app.py
--- a/demo/toga_demo/app.py
+++ b/demo/toga_demo/app.py
@@ -87,8 +87,8 @@
     def action1(self, widget):
         self.main_window.info_dialog('Toga', 'THIS! IS! TOGA!!')
 
-    def action2(self, widget):
-        if self.main_window.question_dialog('Toga', 'Is this cool or what?'):
+    async def action2(self, widget):
+        if await self.main_window.question_dialog('Toga', 'Is this cool or what?'):
             self.main_window.info_dialog('Happiness', 'I know, right! :-)')
         else:
             self.main_window.info_dialog('Shucks...', "Well aren't you a spoilsport... :-(")

{"golden_diff": "diff --git a/demo/toga_demo/app.py b/demo/toga_demo/app.py\n--- a/demo/toga_demo/app.py\n+++ b/demo/toga_demo/app.py\n@@ -87,8 +87,8 @@\n     def action1(self, widget):\n         self.main_window.info_dialog('Toga', 'THIS! IS! TOGA!!')\n \n-    def action2(self, widget):\n-        if self.main_window.question_dialog('Toga', 'Is this cool or what?'):\n+    async def action2(self, widget):\n+        if await self.main_window.question_dialog('Toga', 'Is this cool or what?'):\n             self.main_window.info_dialog('Happiness', 'I know, right! :-)')\n         else:\n             self.main_window.info_dialog('Shucks...', \"Well aren't you a spoilsport... :-(\")\n", "issue": "RuntimeError in toga-demo\n**Describe the bug**\r\nwhen you run the toga-demo app and click on \"Action 2\" and then either Yes or No at the dialog, you get ```RuntimeError: Can't check dialog result directly; use await or an on_result handler``` printed on the console and no followup dialog.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Install toga-core, toga-gtk, toga and demo using `pip install -e`\r\n2. Run toga-demo\r\n3. Click on Action 2\r\n4. Click on either Yes or No in popup dialog\r\n5. Note it logs a RuntimeError in the terminal you ran it from.\r\n\r\n**Expected behavior**\r\nShould not throw an error and instead it should pop up an enthusiastic response dialog.\r\n\r\n**Screenshots**\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/nick/Work/beeware/toga/src/core/toga/handlers.py\", line 66, in _handler\r\n    result = handler(interface, *args, **kwargs)\r\n  File \"/home/nick/Work/beeware/toga/src/core/toga/handlers.py\", line 66, in _handler\r\n    result = handler(interface, *args, **kwargs)\r\n  File \"/home/nick/Work/beeware/toga/demo/toga_demo/app.py\", line 91, in action2\r\n    if self.main_window.question_dialog('Toga', 'Is this cool or what?'):\r\n  File \"/home/nick/Work/beeware/toga/src/gtk/toga_gtk/dialogs.py\", line 16, in __bool__\r\n    raise RuntimeError(\"Can't check dialog result directly; use await or an on_result handler\")\r\nRuntimeError: Can't check dialog result directly; use await or an on_result handler\r\n```\r\n\r\nIf applicable, add screenshots to help explain your problem.\r\n\r\n**Environment:**\r\n - Operating System: Ubuntu 20.04.4\r\n - Python version: 3.8.10\r\n - Software versions:\r\n   - Toga: 0.3.0.dev34 400b6935c4689bedb134324b38eb1286af5b5ec6\r\n   \r\n**Suggested Fix**\r\nIt works if you make the `action2` function async, and make it await the question_dialog.\r\nI'll submit an extremely trivial PR for this soon :-)\r\n\n", "before_files": [{"content": "import toga\nfrom toga.constants import COLUMN\nfrom toga.style import Pack\n\n\nclass TogaDemo(toga.App):\n\n    def startup(self):\n        # Create the main window\n        self.main_window = toga.MainWindow(self.name)\n\n        left_container = toga.OptionContainer()\n\n        left_table = toga.Table(\n            headings=['Hello', 'World'],\n            data=[\n                ('root1', 'value1'),\n                ('root2', 'value2'),\n                ('root3', 'value3'),\n                ('root4', 'value4'),\n            ]\n        )\n\n        left_tree = toga.Tree(\n            headings=['Navigate'],\n            data={\n                ('root1',): {\n                },\n                ('root2',): {\n                    ('root2.1',): None,\n                    ('root2.2',): [\n                        ('root2.2.1',),\n                        ('root2.2.2',),\n                        ('root2.2.3',),\n                    ]\n                }\n            }\n        )\n\n        left_container.add('Table', left_table)\n        left_container.add('Tree', left_tree)\n\n        right_content = toga.Box(style=Pack(direction=COLUMN))\n        for b in range(0, 10):\n            right_content.add(\n                toga.Button(\n                    'Hello world %s' % b,\n                    on_press=self.button_handler,\n                    style=Pack(padding=20)\n                )\n            )\n\n        right_container = toga.ScrollContainer()\n\n        right_container.content = right_content\n\n        split = toga.SplitContainer()\n\n        split.content = [left_container, right_container]\n\n        cmd1 = toga.Command(\n            self.action1,\n            'Action 1',\n            tooltip='Perform action 1',\n            icon='resources/brutus',\n        )\n        cmd2 = toga.Command(\n            self.action2,\n            'Action 2',\n            tooltip='Perform action 2',\n            icon=toga.Icon.TOGA_ICON\n        )\n\n        self.main_window.toolbar.add(cmd1, cmd2)\n\n        self.main_window.content = split\n\n        # Show the main window\n        self.main_window.show()\n\n    def button_handler(self, widget):\n        print(\"button press\")\n        for i in range(0, 10):\n            yield 1\n            print('still running... (iteration %s)' % i)\n\n    def action1(self, widget):\n        self.main_window.info_dialog('Toga', 'THIS! IS! TOGA!!')\n\n    def action2(self, widget):\n        if self.main_window.question_dialog('Toga', 'Is this cool or what?'):\n            self.main_window.info_dialog('Happiness', 'I know, right! :-)')\n        else:\n            self.main_window.info_dialog('Shucks...', \"Well aren't you a spoilsport... :-(\")\n\n\ndef main():\n    return TogaDemo('Toga Demo', 'org.beeware.toga-demo')\n", "path": "demo/toga_demo/app.py"}], "after_files": [{"content": "import toga\nfrom toga.constants import COLUMN\nfrom toga.style import Pack\n\n\nclass TogaDemo(toga.App):\n\n    def startup(self):\n        # Create the main window\n        self.main_window = toga.MainWindow(self.name)\n\n        left_container = toga.OptionContainer()\n\n        left_table = toga.Table(\n            headings=['Hello', 'World'],\n            data=[\n                ('root1', 'value1'),\n                ('root2', 'value2'),\n                ('root3', 'value3'),\n                ('root4', 'value4'),\n            ]\n        )\n\n        left_tree = toga.Tree(\n            headings=['Navigate'],\n            data={\n                ('root1',): {\n                },\n                ('root2',): {\n                    ('root2.1',): None,\n                    ('root2.2',): [\n                        ('root2.2.1',),\n                        ('root2.2.2',),\n                        ('root2.2.3',),\n                    ]\n                }\n            }\n        )\n\n        left_container.add('Table', left_table)\n        left_container.add('Tree', left_tree)\n\n        right_content = toga.Box(style=Pack(direction=COLUMN))\n        for b in range(0, 10):\n            right_content.add(\n                toga.Button(\n                    'Hello world %s' % b,\n                    on_press=self.button_handler,\n                    style=Pack(padding=20)\n                )\n            )\n\n        right_container = toga.ScrollContainer()\n\n        right_container.content = right_content\n\n        split = toga.SplitContainer()\n\n        split.content = [left_container, right_container]\n\n        cmd1 = toga.Command(\n            self.action1,\n            'Action 1',\n            tooltip='Perform action 1',\n            icon='resources/brutus',\n        )\n        cmd2 = toga.Command(\n            self.action2,\n            'Action 2',\n            tooltip='Perform action 2',\n            icon=toga.Icon.TOGA_ICON\n        )\n\n        self.main_window.toolbar.add(cmd1, cmd2)\n\n        self.main_window.content = split\n\n        # Show the main window\n        self.main_window.show()\n\n    def button_handler(self, widget):\n        print(\"button press\")\n        for i in range(0, 10):\n            yield 1\n            print('still running... (iteration %s)' % i)\n\n    def action1(self, widget):\n        self.main_window.info_dialog('Toga', 'THIS! IS! TOGA!!')\n\n    async def action2(self, widget):\n        if await self.main_window.question_dialog('Toga', 'Is this cool or what?'):\n            self.main_window.info_dialog('Happiness', 'I know, right! :-)')\n        else:\n            self.main_window.info_dialog('Shucks...', \"Well aren't you a spoilsport... :-(\")\n\n\ndef main():\n    return TogaDemo('Toga Demo', 'org.beeware.toga-demo')\n", "path": "demo/toga_demo/app.py"}]}