XMNOTEBOOK(3)
πΈ NAME πΈ
XmNotebook β The Notebook widget class. (library call, bestie π )
β¨ SYNOPSIS β¨
#include <Xm/Notebook.h>
π DESCRIPTION π
Okay so Notebook is a manager widget, and its whole personality is taking its children and sorting them into pages, tabs, status areas, and page scrollers so it can simulate a real notebook. All the page children get stacked into the same area, just like real book pages, periodt. Notebook displays visuals that look like the binding of a book and the edges of other pages around the page that is shown. Tab children simulate notebook tabs. Major tabs divide Notebook into several sections, and minor tabs subdivide these sections. Status area children provide additional information about pages such as page numbers. The page scroller child allows the user to move from page to page. Notebook also provides tab scrollers for scrolling major and minor tabs if it cannot display all tabs within its edges.
The application creates pages, tabs, status areas, and page scroller as children of the Notebook widget. Notebook creates tab scrollers when the Notebook is created.
The XmNnotebookChildType constraint resource of Notebook is the vibe check that determines whether a child widget is a page, tab, status area, or page scroller. Any Motif widget can be a page of the Notebook. When the application creates a child of the Notebook widget without setting the child type constraint, the child becomes a page by default, unless it has the XmQTactivatable, XmQTaccessTextual, or XmQTnavigator trait. Children with the XmQTactivatable, XmQTaccessTextual, or XmQTnavigator trait become major tabs, status areas, and page scrollers, respectively.
Notebook uses the XmQTaccessTextual, XmQTactivatable, XmQTjoinSide, and XmQTnavigator traits, and installs the XmQTscrollFrame trait.
To attach a tab to a page, the application creates a tab child of the Notebook and sets the XmNpageNumber constraint to the page number of the targeted page. Same method for a status area widget: that's how it gets attached to a page. The page scroller child, on the other hand, is associated with the Notebook, not with a specific page. Therefore, there is only one valid page scroller for each Notebook.
π Pages π
Only one child of type XmPAGE is displayed at a time by Notebook. Other page children are hidden off-screen. When Notebook displays a particular page, it positions the previously-displayed page off-screen and puts the new page in its place. The page is resized to fit into the dimensions that Notebook has allocated to display pages.
π’ Page Numbers π’
Notebook uses the XmNcurrentPageNumber, XmNfirstPageNumber, and XmNlastPageNumber resources to determine the current page and available page number range. Only those pages whose page numbers are within the range can be displayed. Other pages cannot be displayed until the range between XmNfirstPageNumber and XmNlastPageNumber is changed to include them or their page numbers are changed to a number within the range.
If XmNfirstPageNumber and XmNlastPageNumber are not set explicitly by the application, they are set to 1 by default; Notebook sets XmNlastPageNumber to the largest page number assigned by the application thereafter by default. However, once XmNlastPageNumber is set by the application, Notebook no longer changes it even when a page with a higher page number is managed.
The XmNpageNumber constraint resource is used for specifying the page number of a page widget. It can be set to any integer. For tab and status area children, the resource is used for linking the child widget to a page. For the page scroller child, the resource has no meaning and is ignored by the Notebook.
When a page without a page number is managed, Notebook assigns it the smallest unallocated page number that is not less than the first page number and greater than the last allocated page number. When a tab or a status area without a page number is managed, the newly managed widget is assigned the page number of the most recently managed page, unless the page already has the same type of child. If the page does have the same type of child, Notebook assigns the newly managed widget a page number one greater than the most recently managed page; this new page number is now occupied. Notebook may generate a default page number greater than XmNlastPageNumber, making those pages inaccessible to the user.
π― Duplicate and Empty Pages π―
Since an application can create or change page numbers, it is possible to have duplicate page numbers and empty pages. When two pages with the same page number are managed, only the more recently managed page can be displayed. Inserting a page with an existing page number does not cause a warning. The old page widget cannot be displayed until the new page widget is removed from the Notebook or until the page number of the old page widget is changed to some other number.
An empty page is a page slot where no page is inserted. Empty pages occur when a tab or status area is associated with a page number that has no matching page widget. Empty pages display the blank Notebook background unless the application provides visual information to this empty area while processing XmNpageChangedCallback.
π¨ Notebook Visuals π¨
Notebook draws lines around two sides of the top page to simulate the edges of other pages that are behind the top page. The XmNbackPagePlacement and XmNorientation resources determine which two sides have the lines drawn around them. By default, they are drawn on the bottom and right sides of the top page. The application can set resources to control how many lines are drawn and how wide the area that they are drawn in is. Applications can also choose from three styles of binding visual that simulates the binding of a Notebook. Solid or spiral bindings can be drawn by Notebook, or the application can supply a pixmap that is tiled into the binding.
ποΈ Tabs ποΈ
A major or minor tab is a Motif widget with the XmQTactivatable trait. If a widget without the trait is created for a tab, Notebook does not provide the page activation callback. As a result, even though the tab is displayed, it cannot automatically move the associated page to the top.
Major tabs divide the Notebook pages into sections. Minor tabs subdivide these sections. Only minor tabs associated with the current section are displayed, where a section consists of the group of pages between the current major tab and the next major tab, including the current major tab but not including the page containing the next major tab. The exception to this is when there is no preceding major tab, in which case the section starts from the XmNfirstPageNumber value. A user in one major tab section does not see the minor tabs in other sections. However, all tabs are used in computing the size of the Notebook.
Unlike regular notebook tabs, tabs in the Notebook are not attached to a physical page (a widget). They are, instead, attached to a logical page (a page number). Therefore, it is possible to have a tab with an empty page. When a page with a tab is removed from the Notebook, the tab is not removed because it is still bound to a logical page. Destroying or unmanaging a page widget only erases the page and leaves an empty page. It does not tear the page out of the Notebook. To remove the tab, the application must explicitly destroy or unmanage it.
Notebook supports the XmQTjoinSide trait. A widget that has the XmQTjoinSide trait can be added to the Notebook as a Major or Minor tab and will appear to be attached to its associated page with no margins or shadows between them.
π Status Areas π
A status area is any widget that is used for describing the associated page. For example, the Label widget as a status area child can hold a simple string or a pixmap that describes a page. A status area widget is also attached to a page by the page number constraint resource. Therefore, it is possible to have multiple status area widgets for one page. Only the most recently managed status area widget for that page can be displayed. All others for that page are not unmanaged, but their sizes are used for computing the size of the Notebook. If no status area widget is provided, the Notebook displays its blank background in the status area's reserved space. Notebook does not create any default status area widget.
π Page Scrollers π
The page scroller of the Notebook is any widget that the application creates for scrolling pages. If the application does not create one when the Notebook is realized, Notebook creates a SpinBox widget as the default page scroller. If the application creates a new page scroller, the default page scroller is destroyed. If the application creates multiple page scrollers, only the most recently managed one can be displayed and used. All others are unmanaged.
The default SpinBox page scroller grays out one of the arrow visuals if the current page is a boundary page. If the current page is the first page, the previous arrow of the SpinBox is grayed. If the current page is the last page, the next arrow of the SpinBox is grayed.
π Tab Scrollers π
Okay bestie, so these little cuties exist for one reason and one reason only: scrolling major tabs and minor tabs. That's the whole job description. π
The moment the Notebook gets initialized, it goes ahead and births four ArrowButtonGadgets for you. Four. Like a lil squad. π«Ά They scroll to:
- the next major tab
- the previous major tab
- the next minor tab
- the previous minor tab
And here's the tea: the application cannot replace these tab scrollers. Nope. Not happening. They're yours forever, bestie, no takebacks. π
What you can do is change all resources of these widgets β literally all of them β except the position and the arrow direction. Those two are off-limits. Periodt. π
Tab scrollers are only visible and enabled when there just isn't enough space to display all the major or minor tabs that belong to the page. They also get grayed out whenever scrolling would be inappropriate, iykyk. β¨
Here's the full roster of tab scrollers that get created β Child Widgets that XmNotebook Creates:
- Page Scroller β name:
PageScroller, widget class:XmSpinBox - Next Major Tab Scroller β name:
MajorTabScrollerNext, widget class:XmArrowButtonGadget - Previous Major Tab Scroller β name:
MajorTabScrollerPrevious, widget class:XmArrowButtonGadget - Next Minor Tab Scroller β name:
MinorTabScrollerNext, widget class:XmArrowButtonGadget - Previous Minor Tab Scroller β name:
MinorTabScrollerPrevious, widget class:XmArrowButtonGadget
Now for the main character moment. π
When the user selects the page scroller, a major tab, or a minor tab, the value of XmNcurrentPageNumber gets changed to the selected page number, and XmNpageChangedCallback gets invoked. Slay.
Then, once the application returns from that callback, the Notebook displays the last page child whose page number is equal to the current page number. It also displays the last matched status area child. And everything else? All the other pages and status areas? Automatically hidden. Poof. Gone. π
Major tabs and minor tabs that can actually fit into the Notebook's edges get displayed and positioned appropriately β and all the other tabs are hidden too. Bye. πΈ
Oh and bestie, you don't have to rely on the user clicking things either. The application can also cause a page change itself by calling XtSetValues on XmNcurrentPageNumber and then calling XtCallCallbacks on XmNpageChangedCallback. DIY page flipping, iconic. π₯
π§ Orientation π§
okay bestie so your Notebook can show up in eight different visual configurations β¨ and which one you get depends on two resources: XmNbackPagePlacement and XmNorientation. These two little icons literally decide where everything lives β the back pages, the binding, the major tabs, the minor tabs, the status area, and the page scroller. π
Here's the tea on how it all gets arranged:
- Where the binding goes is decided by
XmNorientation. That's its whole job. - Major tabs always sit on the back page side that's opposite the binding. no cap.
- Minor tabs live on the back page display area that's visually connected to the binding.
- Both major and minor tabs are ordered so the page numbers they give you increase as they get closer to the corner where the back pages meet. π
- The status area and the page scroller are always at the bottom of the Notebook, inside the frame. every single time, no exceptions.
- The page scroller is always placed adjacent to a back page side.
The default back page value and the default orientation are both based on XmNlayoutDirection. π¦
so here's the full rundown of every possible configuration and where each Notebook component ends up in it:
XmNbackPagePlacement:XmBOTTOM_RIGHT,XmNorientation:XmHORIZONTAL- Major Tabs:
RIGHT - Minor Tabs:
BOTTOM - Status Area:
BOTTOM LEFT - Page Scroller:
BOTTOM RIGHT - Binding:
LEFT
- Major Tabs:
XmNbackPagePlacement:XmBOTTOM_RIGHT,XmNorientation:XmVERTICAL- Major Tabs:
BOTTOM - Minor Tabs:
RIGHT - Status Area:
BOTTOM LEFT - Page Scroller:
BOTTOM RIGHT - Binding:
TOP
- Major Tabs:
XmNbackPagePlacement:XmBOTTOM_LEFT,XmNorientation:XmHORIZONTAL- Major Tabs:
LEFT - Minor Tabs:
BOTTOM - Status Area:
BOTTOM RIGHT - Page Scroller:
BOTTOM LEFT - Binding:
RIGHT
- Major Tabs:
XmNbackPagePlacement:XmBOTTOM_LEFT,XmNorientation:XmVERTICAL- Major Tabs:
BOTTOM - Minor Tabs:
LEFT - Status Area:
BOTTOM RIGHT - Page Scroller:
BOTTOM LEFT - Binding:
TOP
- Major Tabs:
XmNbackPagePlacement:XmTOP_RIGHT,XmNorientation:XmHORIZONTAL- Major Tabs:
RIGHT - Minor Tabs:
TOP - Status Area:
BOTTOM LEFT - Page Scroller:
BOTTOM RIGHT - Binding:
LEFT
- Major Tabs:
XmNbackPagePlacement:XmTOP_RIGHT,XmNorientation:XmVERTICAL- Major Tabs:
TOP - Minor Tabs:
RIGHT - Status Area:
BOTTOM LEFT - Page Scroller:
BOTTOM RIGHT - Binding:
BOTTOM
- Major Tabs:
XmNbackPagePlacement:XmTOP_LEFT,XmNorientation:XmHORIZONTAL- Major Tabs:
LEFT - Minor Tabs:
TOP - Status Area:
BOTTOM RIGHT - Page Scroller:
BOTTOM LEFT - Binding:
RIGHT
- Major Tabs:
XmNbackPagePlacement:XmTOP_LEFT,XmNorientation:XmVERTICAL- Major Tabs:
TOP - Minor Tabs:
LEFT - Status Area:
BOTTOM RIGHT - Page Scroller:
BOTTOM LEFT - Binding:
BOTTOM
- Major Tabs:
and for tab group traversal inside the Notebook, there are three tab groups: the major tabs, the minor tabs, and the page scroller. π
your app can also cook up its own extra types of tab groups inside the Notebook β for example, every page the application adds is treated as a separate tab group by the traversal actions. iconic behavior honestly. π
ποΈ Classes ποΈ
Notebook inherits behavior, resources, and traits from the Core, Composite, Constraint, and XmManager classes. family tree fr fr πΈ
- The class pointer is
xmNotebookWidgetClass. - The class name is
XmNotebook.
β¨ New Resources β¨
okay so the table below defines a whole set of widget resources that you (the programmer, the main character π ) use to specify data. You can also set resource values for the inherited classes to set attributes for this widget. yk how it is.
Wanna reference a resource by name or by class in a .Xdefaults file? easy:
- Drop the
XmNorXmCprefix and use the remaining letters. βοΈ - To specify one of the defined values for a resource in a
.Xdefaultsfile, drop theXmprefix and use the remaining letters β either lowercase or uppercase, your call, but keep any underscores between words. π
and the codes in the access column tell you what you're allowed to do:
Cβ can be set at creation timeSβ can be set by usingXtSetValuesGβ can be retrieved by usingXtGetValuesN/Aβ not applicable
The following table defines a set of widget resources used by the programmer to specify data.
So like, here's the whole resource set, bestie β every knob the Notebook has, laid out all pretty. Each one shows its Name, its Class, its Type, the Default, and the Access level. Slay. π
XmNbackPageBackgroundβ classXmCBackPageBackground, typePixel, defaultdynamic, accessCSGXmNbackPageForegroundβ classXmCBackPageForeground, typePixel, defaultdynamic, accessCSGXmNbackPageNumberβ classXmCBackPageNumber, typeCardinal, default2, accessCSGXmNbackPagePlacementβ classXmCBackPagePlacement, typeunsigned char, defaultdynamic, accessCSGXmNbackPageSizeβ classXmCBackPageSize, typeDimension, default8, accessCSGXmNbindingPixmapβ classXmCBindingPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNbindingTypeβ classXmCBindingType, typeunsigned char, defaultXmSPIRAL, accessCSGXmNbindingWidthβ classXmCBindingWidth, typeDimension, default25, accessCSGXmNcurrentPageNumberβ classXmCCurrentPageNumber, typeint, defaultdynamic, accessCSGXmNfirstPageNumberβ classXmCFirstPageNumber, typeint, default1, accessCSGXmNframeBackgroundβ classXmCFrameBackground, typePixel, defaultdynamic, accessCSGXmNframeShadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSGXmNinnerMarginHeightβ classXmCInnerMarginHeight, typeDimension, default0, accessCSGXmNinnerMarginWidthβ classXmCInnerMarginWidth, typeDimension, default0, accessCSGXmNlastPageNumberβ classXmCLastPageNumber, typeint, defaultdynamic, accessCSGXmNminorTabSpacingβ classXmCMinorTabSpacing, typeDimension, default3, accessCSGXmNmajorTabSpacingβ classXmCMajorTabSpacing, typeDimension, default3, accessCSGXmNorientationβ classXmCOrientation, typeunsigned char, defaultXmHORIZONTAL, accessCSGXmNpageChangedCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC
πΈ XmNbackPageBackground πΈ
Okay so this one sets the background color for drawing back pages. The default? It's a lower-intensity version of XmNframeBackground. Like it's the soft-focus, toned-down sibling of the frame. We love a subtle queen. π
π¦ XmNbackPageForeground π¦
Sets the foreground color for drawing back pages. The default is taken from the application's default foreground color. No cap, it just borrows the app's whole vibe.
β¨ XmNbackPageNumber β¨
Specifies the number of lines to draw for back pages. The minimum value is 1, and the maximum value is (XmNbackPageSize / 2). Yes bestie, there's a ceiling and it's literally half of the back page size. Respect the math. π«Ά
π XmNbackPagePlacement π
Specifies where to place the back pages. The default is dependent on the XmNlayoutDirection resource of the Notebook's instance parents. It can have one of the following values:
XmBOTTOM_RIGHTβ Displays back pages on the Notebook's bottom and right sides.XmBOTTOM_LEFTβ Displays back pages on the Notebook's bottom and left sides.XmTOP_RIGHTβ Displays back pages on the Notebook's top and right sides.XmTOP_LEFTβ Displays back pages on the Notebook's top and left sides.
Pick your corner, it's giving interior design. π
π XmNbackPageSize π
Specifies the thickness of the back page rendering. Thicc or thin, you decide. β¨
π§ XmNbindingPixmap π§
Specifies the pixmap or bitmap</pixmap> for stippling or tiling the binding, but only when XmNbindingType is XmPIXMAP or XmPIXMAP_OVERLAP_ONLY. It's the accessory that only works with certain outfits, iykyk. π
π XmNbindingType π
Specifies the binding type. It can have one of the following values:
XmNONEβ Displays no binding. Bare. Minimalist. Main character energy. π¦XmSOLIDβ Displays a solid binding in the foreground color of the Notebook, within the binding area specified byXmNbindingWidth. Clean, classic, iconic.XmSPIRALβ Displays a spiral binding in the foreground color of the Notebook, within the area specified byXmNbindingWidthand within the area outside of the frame equal to the area specified byXmNbindingWidth.XmPIXMAPβ so the binding gets drawn using the pixmap or bitmap you set inXmNbindingPixmap, and it's applied as a stipple or a tile. The stippling uses the Notebook's foreground color, bestie. And the binding width? It's decided by whichever is bigger:XmNbindingWidthor the actual width of that pixmap/bitmap. So the pixmap can absolutely overrule you, iykyk. πXmPIXMAP_OVERLAP_ONLYβ same deal, same stipple-or-tile treatment of whateverXmNbindingPixmappoints at, same Notebook foreground color for the stippling β¨ β but the binding only shows up within the binding area you specified withXmNbindingWidth. No overflow, no spilling out, it stays in its lane. Periodt. π
XmNbindingWidth
Specifies the width of the Notebook binding. Okay but here's the tea π«: if XmNbindingType is XmPIXMAP and the width of the pixmap you dropped into XmNbindingPixmap is greater than XmNbindingWidth, then this resource gets ignored and the pixmap's width becomes the Notebook binding width instead. So the pixmap wins that fight, no cap. π
XmNcurrentPageNumber
Specifies the page number of the page that's currently on display. At first it's set to XmNfirstPageNumber. If somebody sets it to something less than XmNfirstPageNumber, it snaps back to XmNfirstPageNumber. And if it's set to XmNlastPageNumber, then it's set to XmNlastPageNumber. The Notebook does not play around with out-of-bounds page numbers. π
XmNfirstPageNumber
Specifies the page number for the first page of the Notebook. The Notebook does not scroll to any page numbers below this value. That's the floor, babes. π«
XmNframeBackground
Specifies the background color used for drawing the Notebook's frame. Aesthetic choices live here. π
XmNframeShadowThickness
Specifies the shadow thickness around the Notebook's frame. Give it some dimension, it's giving depth. β¨
XmNinnerMarginHeight
Specifies the margin on the top and bottom sides of the page, status area, and page scroller widgets. Breathing room, we love to see it. π«Ά
XmNinnerMarginWidth
Specifies the margin on the left and right sides of the page, status area, and page scroller widgets. Symmetry slay. π
XmNlastPageNumber
Specifies the page number for the last page of the Notebook. The Notebook does not scroll to any page numbers above this value β that's the ceiling, bestie. The default page number is the largest page number of a managed page, major tab, or minor tab widget.
β οΈ Okay listen: if you set this to a value that is less than XmNfirstPageNumber, the behavior of the Notebook is undefined. Don't do it. Not even ironically. π
XmNmajorTabSpacing
Specifies the spacing distance between major tabs. But plot twist π₯: if XmNframeShadowThickness is greater than XmNmajorTabSpacing, then this resource is ignored and the size of XmNframeShadowThickness is used as the spacing distance between major tabs instead. The shadow eats the spacing. It's giving main character energy fr fr.
XmNminorTabSpacing
Specifies the spacing distance between minor tabs. Same vibe check as above: if XmNframeShadowThickness is greater than XmNminorTabSpacing, this resource is ignored and the size of XmNframeShadowThickness is used as the spacing distance between minor tabs. π¦
XmNorientation
Specifies the orientation of the Notebook. It can have one of these values:
XmHORIZONTALβ places the binding beside the pages, on the left or right side of the frame. Sideways binding, she's standing next to you. πXmVERTICALβ places the binding above or below the pages, in the top or the bottom of the frame. Binding on top, very demure, very mindful. πΈ
XmNpageChangedCallback
Specifies the list of callbacks to call whenever XmNcurrentPageNumber (that's the current page number, if you didn't catch it) is changed. And yes, that includes the moment the widget gets realized and the page number is initialized β it counts. π«Ά
The callback structure is XmNotebookCallbackStruct. The reason is XmCR_MAJOR_TAB, XmCR_MINOR_TAB, XmCR_PAGE_SCROLLER_INCREMENT, XmCR_PAGE_SCROLLER_DECREMENT, or XmCR_NONE, depending on what action caused the Notebook to display a new page. So like, the callback always tells you why it's yelling at you. π£
β¨ XmNotebook Constraint Resource Set β¨
Okay so this is the little resource lineup for the children of a Notebook β the constraint set, not the widget's own set. Here's everybody in the group chat: π
XmNnotebookChildTypeβ classXmCNotebookChildType, typeunsigned char, default dynamic, access CG.XmNpageNumberβ classXmCPageNumber, typeint, default dynamic, access CSG.XmNresizableβ classXmCResizable, typeBoolean, defaultTrue, access CSG.
XmNnotebookChildType
Specifies the child type of the Notebook. It can be one of the following types:
XmPAGEβ the child is a page of the Notebook. This is the default when the child does not have theXmQTactivatable,XmQTaccessTextual, orXmQTnavigatortrait. Just a page, living her life. πXmMAJOR_TABβ the child is a major tab. This is the default when the child has theXmQTactivatabletrait. Big tab energy. π₯XmMINOR_TABβ the child is a minor tab. Small but mighty. πΈXmSTATUS_AREAβ the child is a status area. This is the default when the child has theXmQTaccessTextualtrait and does not have theXmQTactivatabletrait. It's giving informational. π«ΆXmPAGE_SCROLLERβ the child is the page scroller. The default page scroller is destroyed, if it exists. Any previously created page scrollers are unmanaged. This is the default when the child has theXmQTnavigatortrait and does have theXmQTactivatabletrait or theXmQTaccessTextualtrait. So yeah, it takes over the scroller role and the old one gets ghosted. π»
XmNpageNumber
Specifies the page number associated with the widget. If the widget is a page, the number specifies the page number of that widget. If the widget is not a page, the number specifies the page number of the associated page. And if the application doesn't supply one at all? Notebook generates the smallest unallocated page number when the child is managed. Ngl that's thoughtful of it. π
Heads up: this resource is ignored for the page scroller. She doesn't need a page number, she is the navigation. β¨
XmNresizable
Specifies whether this child can request a resize. Yes or no, bestie β can she grow? π¦
β¨ Inherited Resources β¨
Okay so Notebook is literally not doing all this by itself, bestie β it inherits behavior and resources from its superclasses, and those are laid out in the resource sets below. For the full tea on every single resource, you gotta go read the reference page for that superclass. No cap. π
Every row is: name β class β type β default β access.
π XmManager Resource Set π
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSG.XmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSG.XmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSG.XmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSG.XmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultNULL, accessCSG.XmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCG.XmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSG.XmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNshadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSG.XmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCG.XmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSG.XmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSG.XmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSG.XmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSG.XmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG.
π Composite Resource Set π
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessG.XmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSG.XmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG.
Core Resource Set π
okay bestie, here's the whole core lineup β every single one of these is a resource your Notebook widget is rocking. The deets go: name, class, type, default, and who's allowed to peek at it (that's the access column). No skipping, we're doing all of them β¨
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGπXmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCGπXmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCGXmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSG
Callback π
so when XmNpageChangedCallback fires, this is the struct that gets slid your way. A pointer to it is passed to the callbacks, periodt:
typedef struct
{
int reason;
XEvent *event;
int page_number;
Widget page_widget;
int prev_page_number;
Widget prev_page_widget;
} XmNotebookCallbackStruct;
and here's what every field is giving, one by one π¦
reasonβ Specifies the reason for the callback.eventβ Points to theXEventthat triggered the callback. It can beNULL.page_numberβ Indicates the page number to be displayed.page_widgetβ Indicates the page widget that has the new page number. It isNULLif no page widget with the page number is found.prev_page_numberβ Indicates the page number of the currently displayed page. If the callback procedure is being called at widget initialization, this page number will be returned asXmUNSPECIFIED_PAGE_NUMBER. πprev_page_widgetβ Indicates the currently displayed page widget. If the callback procedure is being called at widget initialization,NULLwill be returned.
Translations πΈ
Notebook inherits translations from Manager. that's it, that's the whole vibe π
π Accelerators π
Notebook accelerators get added to all the major tab and minor tab children of XmNotebook. Bestie, they're everywhere. Obsessed.
The notebook accelerators are listed below β but heads up, these accelerators might not directly correspond to a translation table. That's just how it is, no cap.
<osfBeginLine>β runsTraverseTab(Home)π«<osfEndLine>β runsTraverseTab(End)π«<osfLeft>β runsTraverseTab(Previous)π«<osfRight>β runsTraverseTab(Next)π«<osfUp>β runsTraverseTab(Previous)π«<osfDown>β runsTraverseTab(Next)π«
β¨ Action Routines β¨
The notebook action routines are literally described below, and there's exactly one, she's an icon:
TraverseTab(Home|End|Next|Previous)β moves the focus on major or minor tabs. That's her whole job and she slays it π
π Additional Behavior π
The Notebook widget has the extra behavior described below, and it's giving main character energy:
<Tab>β Notebook intercepts tab group traversal when traversal is entering or leaving major or minor tabs. Why? To support major tabs and minor tabs as two separate tab groups even when they're actually treated as one by traversal. π
So: if a minor tab has keyboard focus and a user or program action specifies XmTRAVERSE_PREV_TAB_GROUP, keyboard focus will go to a major tab. And if a major tab has keyboard focus and a user or program action specifies XmTRAVERSE_NEXT_TAB_GROUP, keyboard focus will go to a minor tab. It's a whole back-and-forth, fr fr π
π§ Virtual Bindings π§
The bindings for virtual keys are vendor specific β so it depends on your vendor, bestie, iykyk. For information about bindings for virtual buttons and keys, see VirtualBindings(3). π
π RELATED π
Go read these next, they're all part of the fam:
Composite(3)Constraint(3)Core(3)XmCreateNotebook(3)XmManager(3)XmNotebookGetPageInfo(3)XmVaCreateNotebook(3)XmVaCreateManagedNotebook(3)
And that's the whole page, babe π This was the XmNotebook(library call) manual page β yes, the library-call one, from the Motif source, date and all. You read every single line and I'm so proud of you. Go build something cute with your notebook widget. Byeee ππ¦β¨
π¦ where this page comes from
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms