Taking control with FlatNotebook
The FlatNotebook
control is a custom notebook control provided by the wx.lib
module. It offers many additional basic and advanced features over the simple wx.Notebook
class that is offered by the main library. For example, tabs are able to have close buttons on them along with several different visual display styles, and tabs can be dragged and reordered. As FlatNotebook
is an owner-drawn control, it provides a lot more options for taking control of the behavior of your application. In this recipe, we will take a look at some of the useful features that FlatNotebook
has to offer.
How to do it…
Perform the following steps:
First, we will define the constructor for a subclass of
FlatNotebook
, as follows:import wx import wx.lib.agw.flatnotebook as fnb class EditorBook(fnb.FlatNotebook): def __init__(self, parent): mystyle = fnb.FNB_DROPDOWN_TABS_LIST|\ fnb.FNB_FF2|\ fnb.FNB_SMART_TABS|\ fnb.FNB_X_ON_TAB...