[Pharo-project] probably modal problem
Hi guys when I open 1.4 and I use the default browser edit a method then do not accept it click on another method. I get prompt (method promptForCancel) and the discard or accept do not work. I think that there is a problem with exception or something like that. Apparently the method confirm: 'Code has been modified.\What do you want to do?' translated withCRs trueChoice: 'Accept' translated falseChoice: 'Discard' translated cancelChoice: 'Cancel' translated default: nil. never returns it seems that findContextSuchThat: is sent to nil. I tried to understand if this is related to the introduction of a breakpoint in the method but I do not think so. calleeOf: aContext "Return the context whose sender is aContext. Return nil if aContext is on top. Raise error if aContext is not in process chain." suspendedContext == aContext ifTrue: [^ nil]. ^ (suspendedContext findContextSuchThat: [:c | c sender == aContext]) ifNil: [self error: 'aContext not in process chain'] promptForCancel "Ask for the appropriate action to take when unaccepted contents would be overwritten." | choice | choice := ( UIManager default confirm: 'Code has been modified.\What do you want to do?' translated withCRs trueChoice: 'Accept' translated falseChoice: 'Discard' translated cancelChoice: 'Cancel' translated default: nil ). choice ifNotNil: [ choice ifTrue: [ self accept ] ifFalse: [ self model clearUserEditFlag ]] => confirm: queryString trueChoice: trueChoice falseChoice: falseChoice cancelChoice: cancelChoice default: defaultOption "Put up a yes/no/cancel menu with caption queryString. The actual wording for the choices will be as provided in the trueChoice, falseChoice and cancelChoice parameters. defaultOption should be one of true, false or nil to set the default button. Answer true if the response is the true-choice, false if it's the false-choice, nil if the cancelChoice. This is a modal question -- the user must respond." (ProvideAnswerNotification signal: queryString) ifNotNil: [:answer | ^answer]. ^ self theme customQuestionIn: self modalMorph text: queryString yesText: trueChoice noText: falseChoice cancelText: cancelChoice default: defaultOption title: 'Question' translated Stef
Apparently something got corrupted in my system, because I cannot reproducing it in a freshly downloaded image. :( On Apr 21, 2012, at 11:24 PM, Stéphane Ducasse wrote:
Hi guys
when I open 1.4 and I use the default browser edit a method then do not accept it click on another method. I get prompt (method promptForCancel) and the discard or accept do not work.
I think that there is a problem with exception or something like that. Apparently the method confirm: 'Code has been modified.\What do you want to do?' translated withCRs trueChoice: 'Accept' translated falseChoice: 'Discard' translated cancelChoice: 'Cancel' translated default: nil.
never returns it seems that findContextSuchThat: is sent to nil.
I tried to understand if this is related to the introduction of a breakpoint in the method but I do not think so.
calleeOf: aContext "Return the context whose sender is aContext. Return nil if aContext is on top. Raise error if aContext is not in process chain."
suspendedContext == aContext ifTrue: [^ nil]. ^ (suspendedContext findContextSuchThat: [:c | c sender == aContext]) ifNil: [self error: 'aContext not in process chain']
promptForCancel "Ask for the appropriate action to take when unaccepted contents would be overwritten."
| choice | choice := ( UIManager default confirm: 'Code has been modified.\What do you want to do?' translated withCRs trueChoice: 'Accept' translated falseChoice: 'Discard' translated cancelChoice: 'Cancel' translated default: nil ). choice ifNotNil: [ choice ifTrue: [ self accept ] ifFalse: [ self model clearUserEditFlag ]]
=>
confirm: queryString trueChoice: trueChoice falseChoice: falseChoice cancelChoice: cancelChoice default: defaultOption "Put up a yes/no/cancel menu with caption queryString. The actual wording for the choices will be as provided in the trueChoice, falseChoice and cancelChoice parameters. defaultOption should be one of true, false or nil to set the default button. Answer true if the response is the true-choice, false if it's the false-choice, nil if the cancelChoice. This is a modal question -- the user must respond."
(ProvideAnswerNotification signal: queryString) ifNotNil: [:answer | ^answer]. ^ self theme customQuestionIn: self modalMorph text: queryString yesText: trueChoice noText: falseChoice cancelText: cancelChoice default: defaultOption title: 'Question' translated
Stef
participants (1)
-
Stéphane Ducasse