Skip to content

Bitmap.SetSize() is deprecated in wxpython 4.0+, wxpython<4 no longer available through PyPI or Conda-Forge #303

Description

@errthumt

Problem

wxpython 4.0 no longer has SetSize method on Bitmap objects. wxpython<4 is no longer available through standard channels. Standard install methods will pull wxpython 4.x and fail when invoking pdfgui

Install/Startup Method

conda create -n diffpy_test -c conda-forge diffpy.pdfgui
conda activate diffpy_test
pdfgui

Traceback

Traceback (most recent call last):
  File "C:\Users\travi\miniconda3\envs\diffpy_test\Lib\site-packages\diffpy\pdfgui\gui\main.py", line 26, in OnInit
    self.frame = MainFrame(None, -1, "")
                 ~~~~~~~~~^^^^^^^^^^^^^^
  File "C:\Users\travi\miniconda3\envs\diffpy_test\Lib\site-packages\diffpy\pdfgui\gui\mainframe.py", line 193, in __init__
    self.__customProperties()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\travi\miniconda3\envs\diffpy_test\Lib\site-packages\diffpy\pdfgui\gui\mainframe.py", line 421, in __customProperties
    self.__setupToolBar()  # Make the toolbar
    ~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\travi\miniconda3\envs\diffpy_test\Lib\site-packages\diffpy\pdfgui\gui\mainframe.py", line 683, in __setupToolBar
    bitmap.SetSize(size)
    ^^^^^^^^^^^^^^
AttributeError: 'Bitmap' object has no attribute 'SetSize'. Did you mean: 'GetSize'?
OnInit returned false, exiting...

Proposed solution

Quick patch: commenting out any bitmap.SetSize calls in gui/mainframe.py allows startup, but I'm not familiar enough with the whole source code to say that this isn't broken elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions