[wxPython-users] Recent file list

Saketh Bhamidipati saketh.bhamidipati at gmail.com
Tue Jul 25 14:12:27 PDT 2006


On 7/25/06, David Hughes <dfh at forestfield.co.uk> wrote:
>
>
> Saketh Bhamidipati wrote:
>
> I'm trying to implement a recent file list in my application, but I'm
> having some trouble. I'm not sure how recent file lists are conventionally
> implemented, so my method may be different.
>
> First of all, I have a class RecentFileManager which takes care of
> manipulating the recent files file.
>
> <snip>
>
> if there's an easier way to go about implementing recent file lists, I
> would like to hear about it.
>
> Thank you for the assistance.
>
> -Saketh
>
>
> Take a look at wx.FileHistory in the wxPython/wxWidgets docs i.e. *
> wxPython2.6 Docs and Demos\docs\wx.chm*
>
> --
> Regards,
> David Hughes
>
Thanks very much! This is exactly what I needed.

I'm still having problems with one thing, though - how can I make
wx.FileHistory open the file when I click on the item in the Recent Files
menu? I have set the menu for wx.FileHistory to use to a certain menu. The
method I use to open files is called OpenFile(). How can I make each item in
the Recent Files menu bind to OpenFile itself? I've already inserted the
AddFileToHistory() calls in the right places, as well as saving and loading
the config file.

Here's the important part of my code:

        filerecentmenu =3D wx.Menu()
        filemenu.AppendMenu(109, "&Recent Files", filerecentmenu)
        self.hist.UseMenu(filerecentmenu)
        self.hist.AddFilesToMenu()

That's the only problem I have left.

-Saketh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200607=
25/d106a15b/attachment.htm


More information about the wxpython-users mailing list