Skip to content
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

Missing int casting #2650

Closed
lorenzonebolosi opened this issue Nov 21, 2024 · 10 comments
Closed

Missing int casting #2650

lorenzonebolosi opened this issue Nov 21, 2024 · 10 comments

Comments

@lorenzonebolosi
Copy link
Contributor

lorenzonebolosi commented Nov 21, 2024

Description of the problem:
I have found some other error related to missing int casting, however is in the ObjectListView library. Is it possible? Is that library related to this one?

@infinity77
Copy link
Contributor

Are you planning to share them with the rest of us?

@swt2c
Copy link
Collaborator

swt2c commented Nov 21, 2024

I don't see any ObjectListView (except for one random comment) in wxPython source code. Is that a 3rd party library?

@infinity77
Copy link
Contributor

ObjectListView is an external package built a very long time ago - it depends on wxPython but it’s not part of it.

@swt2c
Copy link
Collaborator

swt2c commented Nov 21, 2024

Oh, this? https://pypi.org/project/ObjectListView/

Looks unmaintained, unfortunately. No releases since 2015. You might have to fork it and fix it yourself, unless the issues are actually in wxPython. Post tracebacks?

@lorenzonebolosi
Copy link
Contributor Author

This is the full traceback:

  File "C:\my_project_path\views\DataTreeView.py", line 127, in OnTreeItemSelected
    GasdynPreController().dispatch( events.SelectionEvent(events.SelectionEvent.ITEM_SELECTED,self.currentItem))
  File "C:\my_project_path\patterns\mvc\Controller.py", line 22, in dispatch
    event.commandResult = command().process( event )
  File "C:\my_project_path\control\commands\SelectItemCommands.py", line 42, in process
    ModelLocator().data.selection = selection
  File "C:\my_project_path\patterns\mvc\binding\BindingSupport.py", line 94, in __setattr__
    self.bindables[ name ].value = value
  File "C:\my_project_path\patterns\mvc\binding\BindingSupport.py", line 178, in __setattr__
    callback( self.model, self.name, old_value, value )
  File "C:\my_project_path\views\MdiFrameView.py", line 113, in OnSelectionStateChanged
    page.DisplayDetailsForItem(newSelectionVO.GetFirstSelection() if newSelectionVO else None )
  File "C:\my_project_path\views\MdiFrameView.py", line 227, in DisplayDetailsForItem
    self.dataNotebook.ViewDataForItem(item)
  File "C:\my_project_path\views\DataView.py", line 35, in ViewDataForItem
    panel = item.GetDataView( self )
  File "C:\my_project_path\orm\BaseObjects.py", line 282, in GetDataView
    return self.OnGetDataView( parent )
  File "C:\my_project_path\orm\cylinders\Valves.py", line 257, in OnGetDataView
    return dataview.ValvesPanel( self, parent )
  File "C:\my_project_path\orm\cylinders\dataview\ValvesPanel.py", line 19, in __init__
    valvesListBook = commonvalves.ValvesListNotebook( self.valves, self )
  File "C:\my_project_path\orm\cylinders\dataview\commonvalves\ValvesListNotebook.py", line 16, in __init__
    self.callbackValvesChange()
  File "C:\my_project_path\orm\cylinders\dataview\commonvalves\ValvesListNotebook.py", line 50, in callbackValvesChange
    self.GetCurrentPage().InitializeLayout()
  File "C:\my_project_path\orm\cylinders\dataview\ValvePanel.py", line 28, in InitializeLayout
    valvepanels.LiftsPanel( self.valve, self.notebook ),
  File "C:\my_project_path\orm\cylinders\dataview\valvepanels\LiftsPanel.py", line 27, in __init__
    self.callbackLifts()
  File "C:\my_project_path\orm\cylinders\dataview\valvepanels\LiftsPanel.py", line 67, in callbackLifts
    self.RefreshItems()
  File "C:\my_project_path\orm\cylinders\dataview\valvepanels\LiftsPanel.py", line 70, in RefreshItems
    self.lsvLifts.SetObjects( self.valve.lifts.value )
  File "C:\my_python_path\Python\Python310\lib\site-packages\ObjectListView\ObjectListView.py", line 1007, in SetObjects
    self.RepopulateList()
  File "C:\my_python_path\Python\Python310\lib\site-packages\ObjectListView\ObjectListView.py", line 821, in RepopulateList
    self.AutoSizeColumns()
  File "C:\my_python_path\Programs\Python\Python310\lib\site-packages\ObjectListView\ObjectListView.py", line 632, in AutoSizeColumns
    self._ResizeSpaceFillingColumns()
  File "C:\my_python_path\Python\Python310\lib\site-packages\ObjectListView\ObjectListView.py", line 962, in _ResizeSpaceFillingColumns
    self.SetColumnWidth(i, boundedWidth)
TypeError: ListCtrl.SetColumnWidth(): argument 2 has unexpected type 'float'```

@infinity77
Copy link
Contributor

Traceback comes from ObjectListView - I think @swt2c ’s suggestion is your best way forward, as ObjectListView is unmaintained.

@da-dada
Copy link

da-dada commented Nov 21, 2024

in _ResizeSpaceFillingColumns line 962 set self.SetColumnWidth(i, int(boundedWidth)), I think

@Ecco37
Copy link

Ecco37 commented Nov 23, 2024

Otherwise you can try these links :

https://discuss.wxpython.org/t/ann-objectlistview3/36949

ObjectListView3 (v1.3.5) / Mike Driscoll
Latest version: Jul 15, 2024
https://pypi.org/project/ObjectListView3/

or

https://github.com/driscollis/ObjectListView3

@da-dada
Copy link

da-dada commented Nov 24, 2024

Otherwise you can try these links

and remove all other traps as well

self.freezeUntil = time.clock() + self.updatePeriod

@lorenzonebolosi
Copy link
Contributor Author

Using ObjectListView3 instead of ObjectListView solved the casting issue and probably other errors that I didn't encounter yet. Thanks to everybody!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants