We built a subclass of SimpleDialog with a selectionIndex instance variable, and override:
addList: model lines: maxLines validation: valid
selectionIndex notNil ifTrue: [model selectionIndex: selectionIndex].
^super addList: model lines: maxLines validation: valid
Call like this:
dialog := SimpleDialog2 new.
dialog selectionIndex: (valueColl identityIndexOf: selectedObject ifAbsent: []).
lines := valueColl size + 1 min: Screen default bounds height // 3 // SequenceView defaultGrid.
^dialog
choose: promptString
fromList: stringColl
values: valueColl
buttons: #()
values: #()
lines: lines
cancel: nil
for: nil
Hello All,
Anyone have a doit for a simple list chooser that will *default* to an item (first is okay). Just want to avoid clicking when rarely needed.
Don't need a button list / just vanilla labels list.
"Dialog
choose: 'Which one do you want?'
fromList: #('first' 'second' 'third' 'fourth') values: #(1 2 3 4)
...
?
thx,
Gary
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc