AuiNotebook: Show close button only on some of the notebook tabs

Hi,

With wx.aui.AuiNotebook or wx.lib.agw.aui.AuiNotebook, it is possible
to control on which notebook tabs the close button is shown?

I want some of the pages not closable, while others closable by the
user.

Currently I use AUI_NB_CLOSE_ON_ALL_TABS to show the close button on
all the tabs, and then veto the close events for the non-closable
tabs.

It would be nice to hide the close button on the non-closable tabs.
Does anybody know whether it is possible to do so?

Hi Hong,

2009/7/17 Hong Yuan:

Hi,

With wx.aui.AuiNotebook or wx.lib.agw.aui.AuiNotebook, it is possible
to control on which notebook tabs the close button is shown?

I want some of the pages not closable, while others closable by the
user.

Currently I use AUI_NB_CLOSE_ON_ALL_TABS to show the close button on
all the tabs, and then veto the close events for the non-closable
tabs.

It would be nice to hide the close button on the non-closable tabs.
Does anybody know whether it is possible to do so?

It's not possible with wx.aui, but it should be fairly easy to add in
wx.lib.agw.aui.

Please enter a feature request about it at:

http://trac.wxwidgets.org/

Specifying that the bug is AGW-specific and assign it to me, otherwise
it will get lost in the maze of my e-mail account.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Andrea Gavana wrote:

Specifying that the bug is AGW-specific and assign it to me, otherwise
it will get lost in the maze of my e-mail account.

I've added a new AGW Component in wxTrac, so you don't need to depend on setting AGW in the keywords any longer.

···

--
Robin Dunn
Software Craftsman

Hi Hong,

2009/7/17 Hong Yuan:

Hi,

With wx.aui.AuiNotebook or wx.lib.agw.aui.AuiNotebook, it is possible
to control on which notebook tabs the close button is shown?

I want some of the pages not closable, while others closable by the
user.

Currently I use AUI_NB_CLOSE_ON_ALL_TABS to show the close button on
all the tabs, and then veto the close events for the non-closable
tabs.

It would be nice to hide the close button on the non-closable tabs.
Does anybody know whether it is possible to do so?

I have added this feature in AUI in SVN. It can be used only when you
specify AUI_NB_CLOSE_ON_ALL_TABS: you simply call:

notebook.SetCloseButton(page_index, False)

And the selected page will not be closable and it will not display a
close button. The AUI demo reflects this change: simply choose the
menu "Notebook" => "Set Close Button On All Tabs" and you will see
that page 2 (zero-indexed) has no close button.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/