wxToolbook(3)
π wxToolbook π
okay bestie, so this whole thing is the manual page for wxToolbook, straight out of the Erlang module definitions (that's the manual name, in case you were wondering where the header went π«Ά). It's giving very "I'm a notebook but make it fashion" energy and honestly? obsessed.
β¨ NAME β¨
wxToolbook β it's a class similar to wxNotebook, except instead of tabs it uses a wxToolBar to show the labels. yes, a whole toolbar. iconic behavior honestly. π
π¦ DESCRIPTION π¦
okay so lowkey there is no documentation for this class yet, but the usage is identical to wxNotebook except for the stuff that is clearly tab-only, so for now please go read that class's docs. no cap. you can also use page_samples_notebook to see wxToolbook in action, which is the cute little "go look at it with your own eyes" option. π
One feature of this class that's not supported by wxBookCtrlBase is the support for disabling some of the pages β see EnablePage() (which is not implemented in wx, so don't get your hopes up bestie π).
π Styles π
This class supports the following styles:
wxTBK_BUTTONBARβ uses awxButtonToolBar-based implementation under macOS (and is ignored under every other platform, so it's giving platform-exclusive π).wxTBK_HORZ_LAYOUTβ shows the text and the icons alongside each other, not vertically stacked (only implemented under Windows and GTK 2 platforms, because it relies onwxTB_HORZ_LAYOUTflag support). Also, the commonwxBookCtrlstyles described inoverview_bookctrlare supported too. β¨
π See:
- Overview bookctrl
wxBookCtrlBasewxNotebook- Examples
This class is derived, and can use functions, from:
wxBookCtrlBasewxControlwxWindowwxEvtHandler
wxWidgets docs: wxToolbook
π Events
Event types emitted from this class:
toolbook_page_changedtoolbook_page_changing
π§ DATA TYPES π§
wxToolbook() :: wx:wx_object().
π FUNCTIONS π
π
addPage
addPage(This, Page, Text, [Option]) -> boolean()
when
This :: wxToolbook(),
Page :: wxWindow:wxWindow(),
Text :: unicode:chardata(),
Option ::
{bSelect, boolean()} | {imageId, integer()}.
Adds a new page, slay. π«Ά
The page must have the book control itself as the parent, and must not have been added to this control previously β no double-dipping bestie.
The call to this function will generate the page changing and page changed events if select is true, but not when you're inserting the very first page (because there's no previous page selection to switch from in that case, so it wouldn't make sense to e.g. veto such an event β it's giving "nothing to compare against").
Return: true if it worked, false otherwise.
Remark: Do not delete the page. It will be deleted by the book control. Let the book control have this one, okay? π
See: insertPage/5
π
advanceSelection
advanceSelection(This, [Option]) -> ok
when
This :: wxToolbook(),
Option :: {forward, boolean()}.
Cycles through the tabs. π
The call to this function generates the page changing events.
π
assignImageList
assignImageList(This, ImageList) -> ok
when
This :: wxToolbook(),
ImageList :: wxImageList:wxImageList().
Sets the image list for the page control and takes ownership of the list (so it's yours now, the control is the main character of that list π).
See:
wxImageListsetImageList/2
π
changeSelection
changeSelection(This, Page) -> integer()
when This :: wxToolbook(), Page :: integer().
Changes the selection to the given page, returning the previous selection. π
This function behaves like setSelection/2 but does not generate the page changing events β quiet mode fr fr.
See overview_events_prog for more information.
π
create
create(This, Parent, Id, [Option]) -> boolean()
when
This :: wxToolbook(),
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()}.
Create the tool book control that has already been constructed with the default constructor. β¨
π
deleteAllPages
deleteAllPages(This) -> boolean() when This :: wxToolbook().
Deletes all pages. all of them. every last one. π
π
destroy
destroy(This :: wxToolbook()) -> ok.
Destroys the object. rip bozo πͺ¦
π
getCurrentPage
getCurrentPage(This) -> wxWindow:wxWindow()
when This :: wxToolbook().
Returns the currently selected page, or NULL. π
π
getImageList
getImageList(This) -> wxImageList:wxImageList()
when This :: wxToolbook().
Returns the associated image list β may be NULL, so maybe don't assume bestie.
See:
wxImageListsetImageList/2
π
getPage
getPage(This, Page) -> wxWindow:wxWindow()
when This :: wxToolbook(), Page :: integer().
Returns the window at the given page position. πͺ
π
getPageCount
getPageCount(This) -> integer() when This :: wxToolbook().
Returns the number of pages in the control. counting is self care β¨
π
getPageImage
getPageImage(This, NPage) -> integer()
when This :: wxToolbook(), NPage :: integer().
Returns the image index for the given page. πΌοΈ
π
getPageText
getPageText(This, NPage) -> unicode:charlist()
when This :: wxToolbook(), NPage :: integer().
Returns the string for the given page. π
π
getSelection
getSelection(This) -> integer() when This :: wxToolbook().
Returns the currently selected page, or wxNOT_FOUND if none was selected.
Note: this method may return either the previously or the newly selected page when it's called from theEVT_BOOKCTRL_PAGE_CHANGEDhandler, depending on the platform. so honestly, in that case usewxBookCtrlEvent:getSelection/1instead. iykyk. π
π
hitTest
hitTest(This, Pt) -> Result
when
Result :: {Res :: integer(), Flags :: integer()},
This :: wxToolbook(),
Pt :: {X :: integer(), Y :: integer()}.
Returns the index of the tab at the specified position, or wxNOT_FOUND if there isn't one. π―
If the flags parameter is non-NULL, the position of the point inside the tab is returned as well.
Return: the zero-based tab index, or wxNOT_FOUND if there's no tab at the specified position.
π
insertPage
insertPage(This, Index, Page, Text, [Option]) -> boolean()
when
This :: wxToolbook(),
Index :: integer(),
Page :: wxWindow:wxWindow(),
Text :: unicode:chardata(),
Option ::
{bSelect, boolean()} | {imageId, integer()}.
Inserts a new page at the specified position. placement is everything bestie β¨
Return: true if it worked, false otherwise.
Remark: Do not delete the page, it will be deleted by the book control. π«Ά
See: addPage/4
π
new
new() -> wxToolbook().
Constructs a choicebook control. (yes it literally says choicebook, we are not editing the source material, we simply report it π)
new(Parent, Id, [Option]) -> wxToolbook()
when
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()}.
π
setImageList
setImageList(This, ImageList) -> ok
when
This :: wxToolbook(),
ImageList :: wxImageList:wxImageList().
Sets the image list to use. πΌοΈ
It does not take ownership of the image list β you must delete it yourself. so that's on you, bestie, no pressure π
See:
wxImageListassignImageList/2
π
setPageImage
setPageImage(This, Page, Image) -> boolean()
when
This :: wxToolbook(),
Page :: integer(),
Image :: integer().
Sets the image index for the given page. π¨
image is an index into the image list which was set with setImageList/2.
π
setPageSize
setPageSize(This, Size) -> ok
when
This :: wxToolbook(),
Size :: {W :: integer(), H :: integer()}.
Sets the width and height of the pages. π
Note:</> this method is currently not implemented for wxGTK. so if that's your platform, that's a no from her π
π
setPageText
setPageText(This, Page, Text) -> boolean()
when
This :: wxToolbook(),
Page :: integer(),
Text :: unicode:chardata().
Sets the text for the given page. π
π
setSelection
setSelection(This, Page) -> integer()
when This :: wxToolbook(), Page :: integer().
Sets the selection to the given page, returning the previous selection. π
Notice that the call to this function generates the page changing events β so if you don't want those events to be generated, use the changeSelection/2 function instead. periodt.
See: getSelection/1
and that's the whole page bestie, you ate that π β¨
this lil' manual came to you from Ericsson AB, version wx 2.6, and it's the wxToolbook page, mwah ππ night night, go build something cute π¦
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms