Skip to content

Commit 7611519

Browse files
committed
Add ButtonLabel option for FileSelector
1 parent 6d1560d commit 7611519

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

widgets/+wt/FileSelector.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636

3737
properties (AbortSet)
3838

39+
% Button text that appears on the button
40+
ButtonLabel (1,1) string = ""
41+
3942
% Selection type: (get)file, folder, putfile
4043
SelectionType (1,1) wt.enum.FileFolderState = wt.enum.FileFolderState.file
4144

@@ -174,6 +177,14 @@ function update(obj)
174177
showWarn = strlength(obj.Value) && ~obj.ValueIsValidPath;
175178
obj.WarnImage.Visible = showWarn;
176179

180+
% Update button appearance
181+
obj.ButtonControl.Text = obj.ButtonLabel;
182+
if strlength(obj.ButtonLabel)
183+
obj.Grid.ColumnWidth{4} = 125;
184+
else
185+
obj.Grid.ColumnWidth{4} = 25;
186+
end
187+
177188
end %function
178189

179190

0 commit comments

Comments
 (0)