From 7bf44954b0cd36f9c0ca657a22bd2b728ee171bc Mon Sep 17 00:00:00 2001 From: Mike Driscoll Date: Tue, 19 Jul 2022 11:24:32 -0500 Subject: [PATCH 1/3] Fix issue with image viewer --- chapter42_gui/image_viewer_working.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter42_gui/image_viewer_working.py b/chapter42_gui/image_viewer_working.py index 8e4dec4..dd592a8 100644 --- a/chapter42_gui/image_viewer_working.py +++ b/chapter42_gui/image_viewer_working.py @@ -9,7 +9,7 @@ def __init__(self, parent, image_size): self.max_size = 240 img = wx.Image(*image_size) - self.image_ctrl = wx.StaticBitmap(self, + self.image_ctrl = wx.StaticBitmap(self, bitmap=wx.Bitmap(img)) browse_btn = wx.Button(self, label='Browse') From 04f31edb4ae0d700556405248043e85371027bef Mon Sep 17 00:00:00 2001 From: Mike Driscoll Date: Tue, 19 Jul 2022 11:24:49 -0500 Subject: [PATCH 2/3] Fix issue with image viewer --- chapter42_gui/image_viewer_working.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter42_gui/image_viewer_working.py b/chapter42_gui/image_viewer_working.py index dd592a8..3abd01f 100644 --- a/chapter42_gui/image_viewer_working.py +++ b/chapter42_gui/image_viewer_working.py @@ -39,7 +39,7 @@ def on_browse(self, event): wildcard=wildcard, style=wx.ID_OPEN) as dialog: if dialog.ShowModal() == wx.ID_OK: - self.photo_txt.SetValue(dialog.GetPath()) + self.photo_txt.SetValue(dialog.GetPaths()[0]) self.load_image() def load_image(self): From 47fbb3b296d9a07409764ea83759b9afa03fece1 Mon Sep 17 00:00:00 2001 From: Mike Driscoll Date: Tue, 19 Jul 2022 11:25:54 -0500 Subject: [PATCH 3/3] ignore mypy cache --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9b41e9d..72b5e14 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ chapter22_type_hints/.mypy_cache/ *.pyc *.zip *.db -*.pdf \ No newline at end of file +*.pdf +*.mypy_cache \ No newline at end of file