-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxWidgets version?? #52
Comments
I installed the latest wxPython version when I wrote that book, which was wxPython 4. I think 4.1.1 is out now, but that version should work the same way with this book's code. But yes, the example you mentioned should definitely be You can get the version info by doing this:
|
Thank you.
Being new to Python etc, I am still learning many 'new' things.
There is line missing in the code for the first image viewer code ( p. 24)
in the book: self.max_size = 240
Still, your book has gotten me "off the ground" and I will be referring to
its content on a regular basis as I am getting used to Python and its way
of doing things.
Arnold
…On Tue, Feb 8, 2022 at 8:32 AM Mike Driscoll ***@***.***> wrote:
I installed the latest wxPython version when I wrote that book, which was
wxPython 4. I think 4.1.1 is out now, but that version should work the same
way with this book's code.
But yes, the example you mentioned should definitely be style=wx.FD_OPEN.
I think I had tried that example using an earlier version of wxPython on
accident and left that in there.
You can get the version info by doing this:
import wx
print(wx.version())
—
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACFCLPAKSABA5NPXQBEKMH3U2FASNANCNFSM5NYIKJWQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Can be fixed by using |
Just purchased the book and am working my way through the examples.
In chapter 2, with the image viewer, I have run into one problem and one warning.
FWIW, I am new to wxPython & Python, but not wxWidgets and my goal - partially achieved already - is to use wxFormBuilder as a front-end for designing the GUI itself.
In order to sort out the problems I am running into, I am now running the file image_viewer_working.py from the github repo in the current Visual Stdio Code 1.64.0 (user setup) - running Win 10-64-bit
The problem message when running the code:
_PS D:\pkg\python\wxFB\wxPython\ImageViewer> d:; cd 'd:\pkg\python\wxFB\wxPython\ImageViewer'; & 'C:\Users\arnold\AppData\Local\Programs\PythonCodingPack\python.exe' 'c:\Users\arnold.vscode\extensions\ms-python.python-2022.0.1786462952\pythonFiles\lib\python\debugpy\launcher' '59120' '--' 'd:\pkg\python\wxPython\applications_with_wxpython-master\chapter2_image_viewer\image_viewer_working.py'
Traceback (most recent call last):
File "d:\pkg\python\wxPython\applications_with_wxpython-master\chapter2_image_viewer\image_viewer_working.py", line 43, in on_browse
self.photo_txt.SetValue(dialog.GetPath())
wx.core.wxAssertionError: C++ assertion ""!HasFlag(wxFD_MULTIPLE)"" failed at C:\PROJECTS\bb2\dist-win64-py38\build\ext\wxWidgets\include\wx/filedlg.h(109) in
wxFileDialogBase::GetPath(): When using wxFD_MULTIPLE, must call GetPaths() instead
and the image is never displayed because of this exception.
replacing line 40 : style=wx.ID_OPEN) as dialog:
with : style=wx.FD_OPEN) as dialog:
gives me the warning
d:; cd 'd:\pkg\python\wxFB\wxPython\ImageViewer'; & 'C:\Users\arnold\AppData\Local\Programs\PythonCodingPack\python.exe' 'c:\Users\arnold.vscode\extensions\ms-python.python-2022.0.1786462952\pythonFiles\lib\python\debugpy\launcher' '59190' '--' 'd:\pkg\python\wxPython\applications_with_wxpython-master\chapter2_image_viewer\image_viewer_working.py'
d:\pkg\python\wxPython\applications_with_wxpython-master\chapter2_image_viewer\image_viewer_working.py:62: DeprecationWarning: an integer is required (got type
float). Implicit conversion to integers using int is deprecated, and may be removed in a future version of Python.
img = img.Scale(NewW,NewH)
though the image is displayed as I would expect, though, at this stage I am unsure about what to expect.
Questions:
The first problem is seemingly caused by a mismatch of the wxWidgets versions expected by your code and what is installed on my system - the PC I am running this one has ONLY wxWidgets 3.1.4
The text was updated successfully, but these errors were encountered: