Skip to content

Commit

Permalink
Merge pull request #2095 from proneon267/patch-14
Browse files Browse the repository at this point in the history
Modified WinForms backend to prevent error when window content is not set.
  • Loading branch information
freakboy3742 authored Aug 24, 2023
2 parents 127e8f7 + 186df5b commit 01b076b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changes/2095.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modified WinForms backend to prevent error when window content is not set.
3 changes: 2 additions & 1 deletion winforms/src/toga_winforms/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def refreshed(self):
self.native.MinimumSize = decor_size + min_client_size

def show(self):
self.interface.content.refresh()
if self.interface.content is not None:
self.interface.content.refresh()
if self.interface is not self.interface.app._main_window:
self.native.Icon = self.interface.app.icon._impl.native
self.native.Show()
Expand Down

0 comments on commit 01b076b

Please sign in to comment.