XMNOTEBOOK(3)

πŸ“¦
version 2.3.8 Β· 3 versions
, in arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

🌸 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
  • XmNbackPagePlacement: XmBOTTOM_RIGHT, XmNorientation: XmVERTICAL
    • Major Tabs: BOTTOM
    • Minor Tabs: RIGHT
    • Status Area: BOTTOM LEFT
    • Page Scroller: BOTTOM RIGHT
    • Binding: TOP
  • XmNbackPagePlacement: XmBOTTOM_LEFT, XmNorientation: XmHORIZONTAL
    • Major Tabs: LEFT
    • Minor Tabs: BOTTOM
    • Status Area: BOTTOM RIGHT
    • Page Scroller: BOTTOM LEFT
    • Binding: RIGHT
  • XmNbackPagePlacement: XmBOTTOM_LEFT, XmNorientation: XmVERTICAL
    • Major Tabs: BOTTOM
    • Minor Tabs: LEFT
    • Status Area: BOTTOM RIGHT
    • Page Scroller: BOTTOM LEFT
    • Binding: TOP
  • XmNbackPagePlacement: XmTOP_RIGHT, XmNorientation: XmHORIZONTAL
    • Major Tabs: RIGHT
    • Minor Tabs: TOP
    • Status Area: BOTTOM LEFT
    • Page Scroller: BOTTOM RIGHT
    • Binding: LEFT
  • XmNbackPagePlacement: XmTOP_RIGHT, XmNorientation: XmVERTICAL
    • Major Tabs: TOP
    • Minor Tabs: RIGHT
    • Status Area: BOTTOM LEFT
    • Page Scroller: BOTTOM RIGHT
    • Binding: BOTTOM
  • XmNbackPagePlacement: XmTOP_LEFT, XmNorientation: XmHORIZONTAL
    • Major Tabs: LEFT
    • Minor Tabs: TOP
    • Status Area: BOTTOM RIGHT
    • Page Scroller: BOTTOM LEFT
    • Binding: RIGHT
  • XmNbackPagePlacement: XmTOP_LEFT, XmNorientation: XmVERTICAL
    • Major Tabs: TOP
    • Minor Tabs: LEFT
    • Status Area: BOTTOM RIGHT
    • Page Scroller: BOTTOM LEFT
    • Binding: BOTTOM

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 XmN or XmC prefix and use the remaining letters. βœ‚οΈ
  • To specify one of the defined values for a resource in a .Xdefaults file, drop the Xm prefix 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 time
  • S β€” can be set by using XtSetValues
  • G β€” can be retrieved by using XtGetValues
  • N/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 β€” class XmCBackPageBackground, type Pixel, default dynamic, access CSG
  • XmNbackPageForeground β€” class XmCBackPageForeground, type Pixel, default dynamic, access CSG
  • XmNbackPageNumber β€” class XmCBackPageNumber, type Cardinal, default 2, access CSG
  • XmNbackPagePlacement β€” class XmCBackPagePlacement, type unsigned char, default dynamic, access CSG
  • XmNbackPageSize β€” class XmCBackPageSize, type Dimension, default 8, access CSG
  • XmNbindingPixmap β€” class XmCBindingPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNbindingType β€” class XmCBindingType, type unsigned char, default XmSPIRAL, access CSG
  • XmNbindingWidth β€” class XmCBindingWidth, type Dimension, default 25, access CSG
  • XmNcurrentPageNumber β€” class XmCCurrentPageNumber, type int, default dynamic, access CSG
  • XmNfirstPageNumber β€” class XmCFirstPageNumber, type int, default 1, access CSG
  • XmNframeBackground β€” class XmCFrameBackground, type Pixel, default dynamic, access CSG
  • XmNframeShadowThickness β€” class XmCShadowThickness, type Dimension, default 0, access CSG
  • XmNinnerMarginHeight β€” class XmCInnerMarginHeight, type Dimension, default 0, access CSG
  • XmNinnerMarginWidth β€” class XmCInnerMarginWidth, type Dimension, default 0, access CSG
  • XmNlastPageNumber β€” class XmCLastPageNumber, type int, default dynamic, access CSG
  • XmNminorTabSpacing β€” class XmCMinorTabSpacing, type Dimension, default 3, access CSG
  • XmNmajorTabSpacing β€” class XmCMajorTabSpacing, type Dimension, default 3, access CSG
  • XmNorientation β€” class XmCOrientation, type unsigned char, default XmHORIZONTAL, access CSG
  • XmNpageChangedCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C

🌸 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 by XmNbindingWidth. Clean, classic, iconic.
  • XmSPIRAL β€” Displays a spiral binding in the foreground color of the Notebook, within the area specified by XmNbindingWidth and within the area outside of the frame equal to the area specified by XmNbindingWidth.
  • XmPIXMAP β€” so the binding gets drawn using the pixmap or bitmap you set in XmNbindingPixmap, 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: XmNbindingWidth or 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 whatever XmNbindingPixmap points at, same Notebook foreground color for the stippling ✨ β€” but the binding only shows up within the binding area you specified with XmNbindingWidth. 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 β€” class XmCNotebookChildType, type unsigned char, default dynamic, access CG.
  • XmNpageNumber β€” class XmCPageNumber, type int, default dynamic, access CSG.
  • XmNresizable β€” class XmCResizable, type Boolean, default True, 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 the XmQTactivatable, XmQTaccessTextual, or XmQTnavigator trait. Just a page, living her life. πŸ“„
  • XmMAJOR_TAB β€” the child is a major tab. This is the default when the child has the XmQTactivatable trait. 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 the XmQTaccessTextual trait and does not have the XmQTactivatable trait. 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 the XmQTnavigator trait and does have the XmQTactivatable trait or the XmQTaccessTextual trait. 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 β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG.
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG.
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG.
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG.
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG.
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default NULL, access CSG.
  • XmNlayoutDirection β€” class XmCLayoutDirection, type XmDirection, default dynamic, access CG.
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmTAB_GROUP, access CSG.
  • XmNpopupHandlerCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C.
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 0, access CSG.
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CG.
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG.
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG.
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG.
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG.
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG.

🌈 Composite Resource Set 🌈

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G.
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default NULL, access CSG.
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G.

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 β€” class XmCAccelerators, type XtAccelerators, default dynamic, access CSG πŸ’…
  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G
  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderColor β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG
  • XmNborderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG 🌈
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG
  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access C
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG
  • XmNscreen β€” class XmCScreen, type Screen *, default dynamic, access CG
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default dynamic, access CSG
  • XmNwidth β€” class XmCWidth, type Dimension, default dynamic, access CSG
  • XmNx β€” class XmCPosition, type Position, default 0, access CSG
  • XmNy β€” class XmCPosition, type Position, default 0, access CSG

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 the XEvent that triggered the callback. It can be NULL.
  • page_number β€” Indicates the page number to be displayed.
  • page_widget β€” Indicates the page widget that has the new page number. It is NULL if 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 as XmUNSPECIFIED_PAGE_NUMBER. πŸ‘€
  • prev_page_widget β€” Indicates the currently displayed page widget. If the callback procedure is being called at widget initialization, NULL will 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> β€” runs TraverseTab(Home) πŸ’«
  • <osfEndLine> β€” runs TraverseTab(End) πŸ’«
  • <osfLeft> β€” runs TraverseTab(Previous) πŸ’«
  • <osfRight> β€” runs TraverseTab(Next) πŸ’«
  • <osfUp> β€” runs TraverseTab(Previous) πŸ’«
  • <osfDown> β€” runs TraverseTab(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). πŸ“š


Go read these next, they're all part of the fam:


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 πŸ’–πŸ¦‹βœ¨