Block UI Styler > Blocks > Selection > Tree List
Tree List (Block UI Styler)
Use this block when a tree structure, like the one in the Part Navigator, is required. — verbatim from the doc. This is the widget class NX's own navigators (Part Navigator, etc.) are built from.
The Tree List block creates a tree-node structure representing a node hierarchy. You can add nodes and columns to the tree list and assign callback actions to tree and node events.
Classes:
NXOpen.BlockStyler.Tree— the tree control classNXOpen.BlockStyler.Node— individual node classNXOpen.BlockStyler.TreeListMenu— context-menu classNXOpen.DataContainer— list of objects as unique property names (data form)
Block-specific properties
| Property | Description | Access | Type | Values |
|---|---|---|---|---|
CanStretchHeight |
Height dynamically changes when dialog resizes | CIG | Logical | True/False |
Height |
(numeric — width/height in dialog units; zero = default max width) | |||
Width |
Same pattern as Height — zero sets max default width | |||
SelectionMode |
None / Single / Multiple node selection | None, Single, Multiple | ||
ShowExpandCollapseMarker |
Displays/hides marker on first node showing expanded/collapsed | CSG | Logical | True: displays a + or – sign as a marker. False: no marker. |
ShowHeader |
Displays/hides the header control | CSG | Logical | True: header shown. False: hidden. |
ShowMultipleColumns |
Single column (tree only) vs. first column = tree + additional data columns | CSG | Logical | True: multiple columns. False: single column. |
ShowToolTips |
Shows full text of truncated cells as tooltip on hover | CSG | Logical | True/False |
SortRootNodes |
Whether root nodes can be sorted |
Access codes: C=Creation (Block UI Styler design-time), I=Initialize (API, Initialize callback only), G=Get (API, any callback), S=Set (API, any callback).
Relevance to spine-panel-kit / ArchitectureTab.cpp
This is very likely the real fix for "make the tab look exactly like NX's own
tables." Our current ArchitectureTab.cpp builds a QTreeWidget (genuine Qt,
in-process, hand-styled via QSS/palette to approximate NX's look — branch
glyphs, gray highlight, gridlines all hand-coded). This document shows NX ships a
native BlockStyler Tree/Node control with:
- Built-in
ShowExpandCollapseMarker(+/- glyph) — exactly what the user asked for, natively, no QSS needed. - Built-in header, multi-column, tooltips, sort — everything we hand-built.
- It is registered as: "the one in the Part Navigator" — i.e., the actual widget class backing NX's own navigators, not an approximation.
Open question to resolve next: can a NXOpen.BlockStyler.Tree (typically
built via a .dlx/.blk Block UI Styler dialog definition + generated code) be
hosted inside a ResourceBarManager custom tab's docking window (via
GetWindowHandle), the same way our Qt widget is embedded today? If yes, this
would let us delete the entire hand-rolled Qt styling layer (QSS branch icons,
palette hacks, gridline stylesheet) and get NX's literal native tree for free.
Next research step: look at "Tree List properties and callbacks", "Example —
CreateNode API", "Example — InsertNode API", and how Block UI Styler dialogs are
hosted/embedded (vs. shown as a modal/modeless dialog) — specifically whether a
BlockStyler-generated dialog's tree control can be reparented into an arbitrary
HWND the way our Qt QTreeWidget is via winId()/QWindow::fromWinId.
Source: https://docs.sw.siemens.com/en-US/doc/209349590/PL20220512394070742.blockstyler/bs_tree_list · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)