--- a/PopUpList.st Thu Feb 27 15:34:59 1997 +0100
+++ b/PopUpList.st Thu Feb 27 15:48:03 1997 +0100
@@ -153,6 +153,7 @@
since the list is actually a popupMenu, you can add double-separators:
+ also, here values are different from the labels
[exBegin]
|p|
p := PopUpList label:'dummy'.
@@ -204,22 +205,6 @@
[exEnd]
- another example for different entries:
- [exBegin]
- |p l|
- p := PopUpList label:'dummy'.
- l := OrderedCollection new.
- l add:(LabelAndIcon icon:((Image fromFile:'bitmaps/SBrowser.xbm') magnifiedTo:32@32)
- string:'classes').
- l add:(LabelAndIcon icon:((Image fromFile:'bitmaps/FBrowser.xbm') magnifiedTo:32@32)
- string:'files').
- p list:l.
- p values:#(classes files).
- p action:[:what | Transcript show:'you selected: '; showCR:what].
- p open
- [exEnd]
-
-
with values different from the label strings:
[exBegin]
|p|
@@ -270,6 +255,28 @@
[exEnd]
+ model provides selection; list is explicit:
+ must change the aspect, since the default setup is for a SelectionInList
+ [exBegin]
+ |model top b|
+
+ model := 'foo' asValue.
+
+ top := StandardSystemView new.
+ top extent:(300 @ 200).
+
+ b := PopUpList in:top.
+ b origin:(0.0 @ 0.0) corner:(1.0 @ 0.0).
+ b bottomInset:(b preferredExtent y negated).
+
+ b list:#('hello' 'world' 'this' 'is' 'st/x').
+ b model:model; aspect:#value; change:#value:.
+
+ top openModal.
+ Transcript showCR:('comboBox''s value: ' , model value).
+ [exEnd]
+
+
a popupList and a SelectionInListView on the same model:
[exBegin]
|p slv model|
@@ -878,5 +885,5 @@
!PopUpList class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/PopUpList.st,v 1.39 1997-02-27 14:34:59 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/PopUpList.st,v 1.40 1997-02-27 14:48:03 cg Exp $'
! !