Hi,
I've just tried to replace part of OB-Morphic (the framework to build OmniBrowser interfaces using Morphic) by UIManager.
It worked for:
OBMorphicPlatform>>handleChoiceRequest: request | choice | choice := (PopUpMenu labelArray: request labels lines: request lines) startUpWithCaption: request prompt. ^ request values at: choice ifAbsent: [nil]
I replace it by:
OBMorphicPlatform>>handleChoiceRequest: request ^ UIManager default chooseFrom: request labels values: request values lines: request lines title: (request prompt ifNil: [''])
But how can I change
OBMorphicPlatform>>handleConfirmationRequest: request ^ PopUpMenu confirm: request prompt trueChoice: request okChoice falseChoice: request cancelChoice
There is no such method in UIManager.
And this one:
OBMorphicPlatform>>handleTextRequest: request ^ FillInTheBlankMorph request: request prompt initialAnswer: request template centerAt: Sensor cursorPoint inWorld: World onCancelReturn: nil acceptOnCR: true
There is no way of returning nil on Cancel. The empty string is always returned.
But how can I change
OBMorphicPlatform>>handleConfirmationRequest: request ^ PopUpMenu confirm: request prompt trueChoice: request okChoice falseChoice: request cancelChoice
There is no such method in UIManager.
^(UIManager default confirm: request prompt) ifTrue: [request okChoice] ifFalse: [request cancelChoice]
And this one:
OBMorphicPlatform>>handleTextRequest: request ^ FillInTheBlankMorph request: request prompt initialAnswer: request template centerAt: Sensor cursorPoint inWorld: World onCancelReturn: nil acceptOnCR: true
There is no way of returning nil on Cancel. The empty string is always returned.
To be fair this is a limitation of the UIManager spec.
Assuming that an affirmative "empty" answer can count as being cancelled then...
^(UIManager default request: request prompt initialAnswer: request template) ifNotEmptyDo: [:answer | answer]
Best take the last one from Andreas. What was I thinking... (ifEmpty: []).
-----Original Message----- From: ui-bounces@lists.squeakfoundation.org [mailto:ui-bounces@lists.squeakfoundation.org] On Behalf Of Gary Chambers Sent: 18 September 2007 11:25 am To: Squeak's User Interface Subject: RE: [UI] Improving ToolBuilder
But how can I change
OBMorphicPlatform>>handleConfirmationRequest: request ^ PopUpMenu confirm: request prompt trueChoice: request okChoice falseChoice: request cancelChoice
There is no such method in UIManager.
^(UIManager default confirm: request prompt) ifTrue: [request okChoice] ifFalse: [request cancelChoice]
And this one:
OBMorphicPlatform>>handleTextRequest: request ^ FillInTheBlankMorph request: request prompt initialAnswer: request template centerAt: Sensor cursorPoint inWorld: World onCancelReturn: nil acceptOnCR: true
There is no way of returning nil on Cancel. The empty string is always returned.
To be fair this is a limitation of the UIManager spec.
Assuming that an affirmative "empty" answer can count as being cancelled then...
^(UIManager default request: request prompt initialAnswer: request template) ifNotEmptyDo: [:answer | answer]
UI mailing list UI@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/ui
Reply, no, I was right. Down to the odd behaviour of #ifEmpty: that will always return nil.
-----Original Message----- From: ui-bounces@lists.squeakfoundation.org [mailto:ui-bounces@lists.squeakfoundation.org] On Behalf Of Gary Chambers Sent: 18 September 2007 11:43 am To: 'Squeak's User Interface' Subject: RE: [UI] Improving ToolBuilder
Best take the last one from Andreas. What was I thinking... (ifEmpty: []).
-----Original Message----- From: ui-bounces@lists.squeakfoundation.org [mailto:ui-bounces@lists.squeakfoundation.org] On Behalf Of Gary Chambers Sent: 18 September 2007 11:25 am To: Squeak's User Interface Subject: RE: [UI] Improving ToolBuilder
But how can I change
OBMorphicPlatform>>handleConfirmationRequest: request ^ PopUpMenu confirm: request prompt trueChoice: request okChoice falseChoice: request cancelChoice
There is no such method in UIManager.
^(UIManager default confirm: request prompt) ifTrue: [request okChoice] ifFalse: [request cancelChoice]
And this one:
OBMorphicPlatform>>handleTextRequest: request ^ FillInTheBlankMorph request: request prompt initialAnswer: request template centerAt: Sensor cursorPoint inWorld: World onCancelReturn: nil acceptOnCR: true
There is no way of returning nil on Cancel. The empty string is always returned.
To be fair this is a limitation of the UIManager spec.
Assuming that an affirmative "empty" answer can count as being cancelled then...
^(UIManager default request: request prompt initialAnswer: request template) ifNotEmptyDo: [:answer | answer]
UI mailing list UI@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/ui
UI mailing list UI@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/ui
Hi Gary,
2007/9/18, Gary Chambers gazzaguru2@btinternet.com:
OBMorphicPlatform>>handleConfirmationRequest: request ^ PopUpMenu confirm: request prompt trueChoice: request okChoice falseChoice: request cancelChoice
There is no such method in UIManager.
^(UIManager default confirm: request prompt) ifTrue: [request okChoice] ifFalse: [request cancelChoice]
This is not the same thing because #okChoice and #cancelChoice return strings to be used in the buttons, not in the answers.
Thank you
Ah, ok. Time to discuss extending the flexibility of UIManager in general then!
-----Original Message----- From: ui-bounces@lists.squeakfoundation.org [mailto:ui-bounces@lists.squeakfoundation.org] On Behalf Of Damien Cassou Sent: 18 September 2007 3:09 pm To: Squeak's User Interface Subject: Re: [UI] Improving ToolBuilder
Hi Gary,
2007/9/18, Gary Chambers gazzaguru2@btinternet.com:
OBMorphicPlatform>>handleConfirmationRequest: request ^ PopUpMenu confirm: request prompt trueChoice: request okChoice falseChoice: request cancelChoice
There is no such method in UIManager.
^(UIManager default confirm: request prompt) ifTrue: [request okChoice] ifFalse: [request cancelChoice]
This is not the same thing because #okChoice and #cancelChoice return strings to be used in the buttons, not in the answers.
Thank you
-- Damien Cassou _______________________________________________ UI mailing list UI@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/ui