wxListbook(3)
π wxListbook β aka the manual page, but make it cute π
okay bestie, welcome to the wxListbook(3) page β Erlang Module Definition energy, wx 2.6 era, and yes we're doing this together π«Ά
β¨ NAME β¨
wxListbook β it's a class that's basically wxNotebook's cooler cousin, except instead of tabs it uses a wxListCtrl to show the labels. no cap.
πΈ DESCRIPTION πΈ
So the underlying wxListCtrl shows page labels in a one-column report view by default. that's the vibe, that's the default, don't fight it. but lowkey, if you call wxBookCtrl::SetImageList, the control implicitly switches over to using an icon view instead. so it's giving glow-up, automatically. π
and if you want the actual usage docs for this class, bestie, go read the base abstract class wxBookCtrl. that's where the real lore lives. you can also run the page_samples_notebook to see wxListbook in action, and honestly? obsessed. watch it work. β¨
π Styles
this class supports the following styles, periodt:
wxLB_DEFAULTβ picks the default location for the labels based on whatever platform you're on (left everywhere except on Mac, where it's top). platform-dependent queen πwxLB_TOPβ labels go above the page area.wxLB_LEFTβ labels go on the left side.wxLB_RIGHTβ labels go on the right side.wxLB_BOTTOMβ labels go below the page area.
See:
?wxBookCtrlwxNotebookExamples
This class is derived, and can use functions, from:
wxBookCtrlBasewxControlwxWindowwxEvtHandler
wxWidgets docs: wxListbook
π¬ Events
Event types emitted from this class, and yes these are the ones you're waiting for:
listbook_page_changedlistbook_page_changing
π¦ DATA TYPES π¦
wxListbook() :: wx:wx_object().
short and sweet. iconic.
π FUNCTIONS π
addPage
addPage(This, Page, Text, [Option]) -> boolean()
when
This :: wxListbook(),
Page :: wxWindow:wxWindow(),
Text :: unicode:chardata(),
Option ::
{bSelect, boolean()} | {imageId, integer()}.
Adds a new page. yes, just like that. π
The page must have the book control itself as the parent, and must not have been added to this control previously. so like, no double-dipping, bestie.
This call will generate the page changing and page changed events if select is true β but not when you're inserting the very first page. because at that point there's no previous page selection to switch from, so it literally wouldn't make sense to e.g. veto such an event. the logic is logic-ing π
Return: true if successful, false otherwise.
Remark: Do not delete the page β it will be deleted by the book control. it's not yours anymore, she's got custody π«Ά
See: insertPage/5
advanceSelection
advanceSelection(This, [Option]) -> ok
when
This :: wxListbook(),
Option :: {forward, boolean()}.
Cycles through the tabs. like flipping through a lil flipbook of pages β¨
The call to this function generates the page changing events.
assignImageList
assignImageList(This, ImageList) -> ok
when
This :: wxListbook(),
ImageList :: wxImageList:wxImageList().
Sets the image list for the page control and takes ownership of the list. she said "mine now" π
See:
wxImageListsetImageList/2
changeSelection
changeSelection(This, Page) -> integer()
when This :: wxListbook(), Page :: integer().
Changes the selection to the given page, and returns the previous selection.
This function behaves as setSelection/2 but does not generate the page changing events. quiet, chill, no drama π
See overview_events_prog for more information.
create
create(This, Parent, Id, [Option]) -> boolean()
when
This :: wxListbook(),
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()}.
Create the list book control that has already been constructed with the default constructor. two-step construction, we love a slow burn π
deleteAllPages
deleteAllPages(This) -> boolean() when This :: wxListbook().
Deletes all pages. every single one. gone. bye bestie π
destroy
destroy(This :: wxListbook()) -> ok.
Destroys the object.
getCurrentPage
getCurrentPage(This) -> wxWindow:wxWindow()
when This :: wxListbook().
Returns the currently selected page or NULL.
getImageList
getImageList(This) -> wxImageList:wxImageList()
when This :: wxListbook().
Returns the associated image list, may be NULL.
See:
wxImageListsetImageList/2
getPage
getPage(This, Page) -> wxWindow:wxWindow()
when This :: wxListbook(), Page :: integer().
Returns the window at the given page position.
getPageCount
getPageCount(This) -> integer() when This :: wxListbook().
Returns the number of pages in the control. counting queen π’
getPageImage
getPageImage(This, NPage) -> integer()
when This :: wxListbook(), NPage :: integer().
Returns the image index for the given page.
getPageText
getPageText(This, NPage) -> unicode:charlist()
when This :: wxListbook(), NPage :: integer().
Returns the string for the given page.
getSelection
getSelection(This) -> integer() when This :: wxListbook().
Returns the currently selected page, or wxNOT_FOUND if none was selected.
β οΈ Note that this method may return either the previously or newly selected page when called from theEVT_BOOKCTRL_PAGE_CHANGEDhandler, depending on the platform. so in that case you should usewxBookCtrlEvent:getSelection/1instead. platform chaos, fr fr π
hitTest
hitTest(This, Pt) -> Result
when
Result :: {Res :: integer(), Flags :: integer()},
This :: wxListbook(),
Pt :: {X :: integer(), Y :: integer()}.
Returns the index of the tab at the specified position, or wxNOT_FOUND if there's none. vibe check on a coordinate π
If the flags parameter is non-NULL, the position of the point inside the tab is returned as well.
Return: Returns the zero-based tab index or wxNOT_FOUND if there is no tab at the specified position.
insertPage
insertPage(This, Index, Page, Text, [Option]) -> boolean()
when
This :: wxListbook(),
Index :: integer(),
Page :: wxWindow:wxWindow(),
Text :: unicode:chardata(),
Option ::
{bSelect, boolean()} | {imageId, integer()}.
Inserts a new page at the specified position. scoot over, we're making room πͺβ¨
Return: true if successful, false otherwise.
Remark: Do not delete the page β it will be deleted by the book control. same rule as before, okay? don't do it π
See: addPage/4
new
new() -> wxListbook().
Default ctor. the blank canvas moment π¨
new/3
new(Parent, Id, [Option]) -> wxListbook()
when
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()}.
Constructs a listbook control. main character entrance π
setImageList
setImageList(This, ImageList) -> ok
when
This :: wxListbook(),
ImageList :: wxImageList:wxImageList().
Sets the image list to use.
It does not take ownership of the image list β you must delete it yourself. so like, this one's a situationship, not a commitment. don't forget to clean up after yourself π
See:
wxImageListassignImageList/2
setPageImage
setPageImage(This, Page, Image) -> boolean()
when
This :: wxListbook(),
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 :: wxListbook(),
Size :: {W :: integer(), H :: integer()}.
Sets the width and height of the pages.
Note: This method is currently not implemented for wxGTK. so on GTK she simply does not serve π sorry bestie, that's just the lore.
setPageText
setPageText(This, Page, Text) -> boolean()
when
This :: wxListbook(),
Page :: integer(),
Text :: unicode:chardata().
Sets the text for the given page.
setSelection
setSelection(This, Page) -> integer()
when This :: wxListbook(), 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. loud option vs quiet option, pick your fighter π’π€«
See: getSelection/1
and that's the whole page, bestie, you read all of it, you ate that π β¨
Ericsson AB β’ wx 2.6 β’ wxListbook(3) β that's the source, version and date tag at the bottom, so now you know exactly which era of wxWidgets this queen came from. slay, bye, go build something π¦ππ
π¦ 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