wx.FileHistory question

I’m looking at wx.FileHistory to provide “recent files” functionality. It appears that the stock FileConfig subclass of wx.ConfigBase uses the old Windows .INI file format. For my purposes, I need to use a JSON format for the file. I’m currently digging through the wxWidgets source and found that the strings themselves are stored in a a wxStringArray as wxStrings which likely translates to a Python list in practice.

Is it fair to say that all I need to do is subclass the wx.ConfigBase class to read/write JSON? I assume that if I do so that I will need to implement the entire public interface but I have yet to determine what or how that will impact using a custom subclass for the config object in FileHistory.

Has anyone already done this?

I’d suggest to avoid using the FileConfig (and therefore the Load and Save methods) and just load the strings with repeated AddFileToHistory calls and a series of GetHistoryFile to save them to your JSON. That would be much less work thatn trying to make your own class derived from ConfigBase.

OK, thanks! :grin: