Document/View framework

Hi,

While writing a data analysis program, I wanted to use a document framework to easily display and manipulate multiple datasets. Some searching revealed that wxWidgets has this with wxDocument/wxView and the related classes. Some digging in Phoenix revealed that such classes are present in wx.lib.docview, and that there is an extension of them in wx.lib.pydocview. So, to see how there were used, I took the DocViewDemo from the Classic samples; it was removed from the Phoenix samples. And apparently for a reason, because it took me a bit of work to get it working. After also replacing the EVT_* bindings done with call with self.Bind, I got code that was not crashing but also not working as it should; I leave out the description.

I wanted to use some framework to avoid reinventing the wheel, but now I encountered a square wheel. So, some questions:

  • Are there people using wx.lib.docview that can help me here? Searches on wxPython-users and here do not reveal much questions about it.

  • What is the position with respect to wxDocument/wxView in Phoenix? Is there intent to update this, or bridge to C++ classes?

  • Are there alternatives for a document framework in Phoenix?

  • Would it be worth my time and effort to try and get this working? Considering that I am a hobbyist with little experience in Python, gui programming and working with larger code bases, I don’t feel best placed to do this, but I also don’t mind the opportunity to learn and contribute to the project.

Best regards,

Jan

2 Likes

Hello,
this is great question, but unfortunately with no answer. I run into the same problem (just seven year later :smiley: ). There is lack of detailed documentation for modules wx.lib.docview and wx.lib.pydocview. There is no sample code or demo in wxPython-demo-4.2.1.tar.gz (which is great source and helps me very much).

After all, this is very common task - have a file/document (XML, whatever), open it, manipulate its data in GUI (with undo/redo facility), validate data and then transfer it back to the file.

Or are you reinventing wheel every time?
Could you please share an example code? I have found only something about undo/redo and commandProcessor here wxpython-undo-redo.

Are you guys using alternative framework as a addition to wxPython? Maybe this task or use case is out of scope of GUI framework like wxPython.

Hello,
I have adopted the docview framework to my needs. The result is a plugin based system. The base component is the wbBase package plus a bunch of additional plugins.
A real app based on this stuff is the FontTools Wokbench.
It may serve as an example or starting point for your own app.
Best
Eigi

1 Like

Hello,
I think you can try the wxPython-users mailing list or forums for help, and look for open-source projects on GitHub using wx.lib.docview for practical . May not be fully updated in Phoenix. Monitor the wxPython GitHub repository and community discussions for updates. Using other Python GUI frameworks like PyQt or PySide, which have better-supported document/view architectures.