Skip to content

Commit 7814ea5

Browse files
HanSur94claude
andcommitted
fix: use addWidget return value for tabbed group on page 2
In multi-page mode, addWidget routes to the page's widget list and returns early without appending to d.Widgets. Using d.Widgets{end} after addWidget on page 2 failed with "Array indices must be positive integers" because d.Widgets was empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 06ceb21 commit 7814ea5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

examples/example_dashboard_advanced.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@
222222
% All subsequent addWidget calls route to page 2.
223223

224224
%% Feature 7: GroupWidget tabbed mode — multiple views sharing one space
225-
d.addWidget('group', 'Label', 'Sensor Distributions', 'Mode', 'tabbed', ...
225+
g = d.addWidget('group', 'Label', 'Sensor Distributions', 'Mode', 'tabbed', ...
226226
'Position', [1 1 24 6]);
227-
g = d.Widgets{end};
228227
g.addChild(HistogramWidget('Sensor', sTemp, 'Title', 'Temperature Distribution', ...
229228
'ShowNormalFit', true, 'NumBins', 40), 'Temperature');
230229
g.addChild(HistogramWidget('Sensor', sPress, 'Title', 'Pressure Distribution', ...

0 commit comments

Comments
 (0)