{"action":"opened","issue":{"url":"https://api.github.com/repos/lawsie/guizero/issues/155","repository_url":"https://api.github.com/repos/lawsie/guizero","labels_url":"https://api.github.com/repos/lawsie/guizero/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/lawsie/guizero/issues/155/comments","events_url":"https://api.github.com/repos/lawsie/guizero/issues/155/events","html_url":"https://github.com/lawsie/guizero/issues/155","id":306139220,"number":155,"title":"Multiple windows","user":{"login":"martinohanlon","id":2329501,"avatar_url":"https://avatars3.githubusercontent.com/u/2329501?v=4","gravatar_id":"","url":"https://api.github.com/users/martinohanlon","html_url":"https://github.com/martinohanlon","followers_url":"https://api.github.com/users/martinohanlon/followers","following_url":"https://api.github.com/users/martinohanlon/following{/other_user}","gists_url":"https://api.github.com/users/martinohanlon/gists{/gist_id}","starred_url":"https://api.github.com/users/martinohanlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinohanlon/subscriptions","organizations_url":"https://api.github.com/users/martinohanlon/orgs","repos_url":"https://api.github.com/users/martinohanlon/repos","events_url":"https://api.github.com/users/martinohanlon/events{/privacy}","received_events_url":"https://api.github.com/users/martinohanlon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-17T08:31:22Z","updated_at":"2018-03-17T08:31:22Z","closed_at":null,"author_association":"COLLABORATOR","body":"Currently guizero only supports single window application, it was noted in #130 that creating multiple `App` objects results in odd behaviour.\r\n\r\nMy thoughts on extending the guizero api to support multiple windows are:\r\n\r\n+ `App` remains the 'main' window / application and is launch first.\r\n+ A new class would be introduced called `Window`, this would be used to create other windows\r\n+ `Window` would support a similar set of methods to `App` and widgets would be used in the same way (I am actually thinking App would inherit from Window)\r\n+ `App` and `Window` objects can open and close `Window` objects via `open(window)` and `close(window)` methods.\r\n+ `open` would accept an optional `wait` parameter which when set to false would force the calling window to wait until it was closed (so by creating a modal window).\r\n\r\nSomething a bit like this:\r\n\r\n```python\r\nfrom guizero import App, Window, PushButton\r\n\r\napp = App(title=\"main app window\")\r\nwindow = Window(app, title = \"another window\")\r\nmodal = Window(app, title = \"a modal window\")\r\n\r\ndef open_window():\r\n    app.open(window)\r\n\r\nwindow_button = PushButton(app, text = \"open window\")\r\n\r\ndef open_modal():\r\n    app.open(model, wait = True)\r\n\r\nmodal_button = PushButton(app, text = \"open model\")\r\n\r\napp.display()\r\n\r\n```\r\n\r\nThoughts?"}}
{"actor":{"display_login":"martinohanlon"}}