[BUG] Transcript don't work in 3.6 final in MVC mode
Lic. Edgar J. De Cleene
edgardec2001 at yahoo.com.ar
Sat Apr 17 12:00:46 UTC 2004
On 16/04/04 23:59, "David T. Lewis" <lewis at mail.msen.com> wrote:
> On Thu, Apr 15, 2004 at 09:37:26AM -0300, Lic. Edgar J. De Cleene wrote:
>> Today I work on a final 3.6 image and do some network stuff.
>> When I have the following code:
>>
>> Transcript open.
>> Transcript show: 'starting remote comm test';
>> cr.
>> Transcript show: 'initializing network ... '.
>>
>> Trannscript open , but don¹t show any text.
>>
>> Some can confirm this bug ?
>
> Confirmed. However, it's not really a bug, but rather a limitation
> of the way the Controller works in MVC. Here is what is happening:
>
> When you evaluate a block of code with "Transcript open" in it,
> the "Transcript open" acts like a "GO TO". A new StandardSystemView
> is created for the Transcript, and control is passed directly to
> the controller for this view (a StandardSystemController). Control
> never returns to the remaining expressions in your method, so it
> is just as if your "Transcript show" output goes into the bit bucket.
>
> Take a look at TranscriptStream>>openLabel: and you can see where
> this is happening.
>
> In order to do what you want in MVC, you will need to find a way
> to open the Transcript and have it visible on the screen before
> you write to it. See class DeferredActionStandardSystemController
> for an example of how this can be done. The idea is to use a
> DeferredActionStandardSystemController instead of a normal
> StandardSystemController, then send #addDeferredUIMessage: to
> the controller to schedule actions to occur after the new window
> has been opened.
>
> ProcessBrowser, CommandShell, and CrLfFileEditor provide examples
> of how this is done. CommandShell and CrLfFileEditor are in the
> CommandShell package on SqueakMap, and ProcessBrowser is part
> of the standard image.
>
> Dave
>
Dave:
I modified openLabel: as you suggested with :
openLabel: aString
"Open a window on this transcriptStream"
| topView codeView |
Smalltalk isMorphic ifTrue: [^ (self openAsMorphLabel: aString)
openInWorld].
topView _ (StandardSystemView new) model: self.
topView model: self;
controller: DeferredActionStandardSystemController new;
borderWidth: 1;
label: aString;
minimumSize: 100 @ 50.
codeView _ PluggableTextView on: self text: nil accept: nil
readSelection: nil menu: #codePaneMenu:shifted:.
codeView window: (0 at 0 extent: 200 at 200).
topView addSubView: codeView.
topView controller addDeferredUIMessage: [self endEntry].
topView controller open
Add a Foo class with test method.
test
Transcript open.
self halt.
Transcript show: 'Dave es un amigo'.
Foo test in a workspace and debug it.
Never reach the halt.
What I doing wrong ?
Very, very thanks in advance
Edgar
More information about the Squeak-dev
mailing list
|