[Pharo-project] [COTDC] 42 - ExpanderMorphContracted

Gary Chambers gazzaguru2 at btinternet.com
Wed Apr 6 10:46:55 CEST 2011

"I am an Announcement that occurs when an ExpanderMorph is contracted (rolled-up).

Example where visibility of another UI component depends on the expanded/contracted state of Expander 2

|builder expanders ex1 ex2 text list row|
builder := UITheme builder.
expanders := builder newColumn: {
 ex1 := builder newExpander: 'Expander 1'.
 ex2 := builder newExpander: 'Expander 2'}.
 width: 100;
 hResizing: #rigid.
text := builder
 newTextEditorFor: (ValueHolder new contents: 'Some text')
 getText: #contents setText: #contents:.
list := (builder
 newListFor: (ListModel new list: #('One' 'Two' 'Three' 'Four'); selectionIndex: 3)
 list: #list selected: #selectionIndex changeSelected: #selectionIndex:
 help: 'This is a list')
  minWidth: 120;
  visible: false;
  disableTableLayout: true.
ex2 announcer
 when: ExpanderMorphContracted do: [list hide; disableTableLayout: true];
 when: ExpanderMorphExpanded do: [list show; disableTableLayout: false].
row := builder newRow: {
 (builder newRow: {text. list})
  vResizing: #spaceFill}.
(row openInWindowLabeled: 'Expander Announcements Example') extent: 400 at 300


Regards, Gary

  ----- Original Message ----- 
  From: laurent laffont 
  To: An open mailing list to discuss any topics related to an open-sourceSmalltalk 
  Sent: Tuesday, April 05, 2011 7:32 PM
  Subject: [Pharo-project] [COTDC] 42 - ExpanderMorphContracted

  Today:  ExpanderMorphContracted

  Comment Of The Day Contest - One Day One Comment
  #1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
  #2: If you cannot comment it, deprecate it.

  Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110406/c84de8c6/attachment.htm>

More information about the Pharo-project mailing list