Providing your own information window
When the screen's real estate is at a premium or you just need to show some additional information that may not fit in with your main user interface, a floating MiniFrame
or tool window can be a nice way to show this information while giving the user the ability to place it where they like or to dismiss it entirely when it is no longer needed. In this recipe, we will use a MiniFrame
to make a file information window that shows detailed information about a file selected from the user's hard drive.
How to do it…
Here are the steps that you need to perform:
First, we need to import some additional modules from Python's standard library, as follows:
import os from time import asctime, localtime import stat import mimetypes import wx
Next, we will define a subclass of
MiniFrame
to wrap a panel that we will use to display the file's information:class FileInfoDlg(wx.MiniFrame): def __init__(self, parent, fname): style = wx.DEFAULT_DIALOG_STYLE ...