Second transcript window?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Second transcript window?

John Almberg
Silly question, but is it possible to open a second, named Transcript  
window? I can create a second TranscriptStream, but can't figure out  
how to open it in World.

-- John

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Blake-5
On Mon, 10 Sep 2007 18:44:14 -0700, John Almberg <[hidden email]>  
wrote:

> Silly question, but is it possible to open a second, named Transcript  
> window? I can create a second TranscriptStream, but can't figure out how  
> to open it in World.

The too short to be useful answer is: Yes. <s>

I'm not being coy; I'm sure there's an easy way to do it but the only way  
I can think of is convoluted.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Scott Wallace-2
In reply to this post by John Almberg
Hi, John,

Via the Squeak UI:  each time you choose "open transcript" from the  
"open..." branch of the World menu, a new Transcript window is opened.

Via code:  evaluate "Transcript open".

Cheers,

   -- Scott


On Sep 10, 2007, at 6:44 PM, John Almberg wrote:

> Silly question, but is it possible to open a second, named  
> Transcript window? I can create a second TranscriptStream, but  
> can't figure out how to open it in World.
>
> -- John
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Blake-5
On Mon, 10 Sep 2007 21:20:31 -0700, Scott Wallace <[hidden email]>  
wrote:

> Hi, John,
>
> Via the Squeak UI:  each time you choose "open transcript" from the  
> "open..." branch of the World menu, a new Transcript window is opened.
>
> Via code:  evaluate "Transcript open".

But that doesn't solve addressing the two transcripts separately. If you  
do that, and then do:

Transcript show: 'test'

It'll show up on both. If you bring up the halo and copy the transcript,  
however, you get two completely independent transcripts.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Scott Wallace-2
Ah... if operating a separate "private" transcript is what was being  
inquired about, try this:

With a conventional Transcript or two already open on the screen,  
evaluate the following 3 lines in a workspace:

        ((myTranscript := TranscriptStream new) openAsMorphLabel: 'My  
Private Transcript') openInWorld.
        myTranscript cr; show: 'hello, private transcript'.
        Transcript cr; show: 'hello, system transcript window(s)'.

Cheers,

   -- Scott


On Sep 10, 2007, at 9:33 PM, Blake wrote:

> On Mon, 10 Sep 2007 21:20:31 -0700, Scott Wallace  
> <[hidden email]> wrote:
>
>> Hi, John,
>>
>> Via the Squeak UI:  each time you choose "open transcript" from  
>> the "open..." branch of the World menu, a new Transcript window is  
>> opened.
>>
>> Via code:  evaluate "Transcript open".
>
> But that doesn't solve addressing the two transcripts separately.  
> If you do that, and then do:
>
> Transcript show: 'test'
>
> It'll show up on both. If you bring up the halo and copy the  
> transcript, however, you get two completely independent transcripts.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Göran Krampe
Hi folks!

The "issues" with Transcript keep popping up over the years.

In Gjallar we built a simple Log framework - it is on SM these days called
SimpleLog. It has a Morhpic UI and other features. I should also look at
ToothPick from Joseph Pelrine and see what can be borrowed/integrated -
AFAIK ToothPick supports the syslog UDP protocol and I never got around to
that.

But anyway, SimpleLog is here (check the page for trivial usage pattern):

http://map.squeak.org/packagebyname/simplelog

The second thing we could do is to put SharedStreams into the image and
probably replace SharedQueue with it (SharedStreams should be a superset
of SharedQueue and also be a magnitude faster for character streams) and
at the same time use it for Transcript thus creating a faster and thread
safe variant (multiple producers, single consumer).

regards, Göran

PS. Yes, this is the beginners list - but hey. :)

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

John Almberg
In reply to this post by Scott Wallace-2
Hi all,

Thanks for all the help. Scott's code snippet was exactly what I  
needed. I have a couple streams of results and want to keep them  
separate so they are easier to read.

I had it figured out this far:

((myTranscript := TranscriptStream new) openAsMorphLabel: 'My Private  
Transcript')

But didn't realize I had to call openInWorld to make the window  
appear. Such a big library to learn!

Thanks: John



On Sep 11, 2007, at 1:03 AM, Scott Wallace wrote:

> Ah... if operating a separate "private" transcript is what was  
> being inquired about, try this:
>
> With a conventional Transcript or two already open on the screen,  
> evaluate the following 3 lines in a workspace:
>
> ((myTranscript := TranscriptStream new) openAsMorphLabel: 'My  
> Private Transcript') openInWorld.
> myTranscript cr; show: 'hello, private transcript'.
> Transcript cr; show: 'hello, system transcript window(s)'.
>
> Cheers,
>
>   -- Scott
>
>
> On Sep 10, 2007, at 9:33 PM, Blake wrote:
>
>> On Mon, 10 Sep 2007 21:20:31 -0700, Scott Wallace  
>> <[hidden email]> wrote:
>>
>>> Hi, John,
>>>
>>> Via the Squeak UI:  each time you choose "open transcript" from  
>>> the "open..." branch of the World menu, a new Transcript window  
>>> is opened.
>>>
>>> Via code:  evaluate "Transcript open".
>>
>> But that doesn't solve addressing the two transcripts separately.  
>> If you do that, and then do:
>>
>> Transcript show: 'test'
>>
>> It'll show up on both. If you bring up the halo and copy the  
>> transcript, however, you get two completely independent transcripts.
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Websites for On-line Collectible Dealers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Identry, LLC
John Almberg
(631) 546-5079
[hidden email]
www.identry.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

John Almberg
In reply to this post by Blake-5
Hi Blake,

I tried this every which way. I was able to create a new Transcript  
with the 'make a sibling' halo, but couldn't figure out how to give  
it it's own name (so it was a separate stream). How do you do this?

-- John

On Sep 11, 2007, at 12:33 AM, Blake wrote:

> On Mon, 10 Sep 2007 21:20:31 -0700, Scott Wallace  
> <[hidden email]> wrote:
>
>> Hi, John,
>>
>> Via the Squeak UI:  each time you choose "open transcript" from  
>> the "open..." branch of the World menu, a new Transcript window is  
>> opened.
>>
>> Via code:  evaluate "Transcript open".
>
> But that doesn't solve addressing the two transcripts separately.  
> If you do that, and then do:
>
> Transcript show: 'test'
>
> It'll show up on both. If you bring up the halo and copy the  
> transcript, however, you get two completely independent transcripts.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Websites for On-line Collectible Dealers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Identry, LLC
John Almberg
(631) 546-5079
[hidden email]
www.identry.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Blake-5
On Tue, 11 Sep 2007 05:38:45 -0700, John Almberg <[hidden email]>  
wrote:

> Hi Blake,
>
> I tried this every which way. I was able to create a new Transcript with  
> the 'make a sibling' halo, but couldn't figure out how to give it it's  
> own name (so it was a separate stream). How do you do this?

Scott Wallace put up this code last night (in case you missed it):

((myTranscript := TranscriptStream new) openAsMorphLabel: 'My Private  
Transcript') openInWorld.

You can now address "myTranscript" separately from Transcript:

myTranscript cr; show: 'hello, private transcript'.
Transcript cr; show: 'hello, system transcript window(s)'.

It is possible to do it using morphs, you just have to get a reference to  
that morph. It doesn't seem to matter if you make a sibling copy or not  
(though I'm sure there are ramifications).

So, what you can do is create the copy, inspect it to find out its  
external name ("Transcript1" in my case) and then pull the  
TranscriptStream out of it:

sw := World submorphNamed: 'Transcript1'.
t := sw model.
t show: 'This now contains your independent transcript stream.'

Obviously, Scott's version is cleaner, but I've been struggling with  
trying to interact with already existing objects since I started playing  
with Morphic.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

John Almberg
Hi Blake,

Yes, understood Scott's method. I was wondering about how to do it  
with halos. I tried to do what you suggested and learned a few things  
(like how to inspect a window, which caused some head-scratching  
until I found the 'debug' menu).

But, I wasn't able to create a second, named transcript.

Anyway, no big deal. Scott's method is simple and what I needed. I  
was just curious about the halos (which I haven't used much, yet.)

Thanks for your help.

-- John


>
> It is possible to do it using morphs, you just have to get a  
> reference to that morph. It doesn't seem to matter if you make a  
> sibling copy or not (though I'm sure there are ramifications).
>
> So, what you can do is create the copy, inspect it to find out its  
> external name ("Transcript1" in my case) and then pull the  
> TranscriptStream out of it:
>
> sw := World submorphNamed: 'Transcript1'.
> t := sw model.
> t show: 'This now contains your independent transcript stream.'
>
> Obviously, Scott's version is cleaner, but I've been struggling  
> with trying to interact with already existing objects since I  
> started playing with Morphic.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Second transcript window?

Blake-5
On Wed, 12 Sep 2007 05:59:12 -0700, John Almberg <[hidden email]>  
wrote:

> Hi Blake,
>
> Yes, understood Scott's method. I was wondering about how to do it with  
> halos. I tried to do what you suggested and learned a few things (like  
> how to inspect a window, which caused some head-scratching until I found  
> the 'debug' menu).

Ah. Yes.

> But, I wasn't able to create a second, named transcript.

Well, a morph has a label and an externalName. The label is what you use  
in Etoys. (If you bring up an inspector by clicking on the "eye" icon in  
the halo, the label shows up.) The label is visible in the world, but I  
haven't found a good way in code to ask the World to "give me that morph  
labeled: 'whatever'".

The external name allows you to use the World submorphNamed: message to  
find it. You can also change the name with "Name":

sw := World submorphNamed: 'OldName'.
t := sw model.
t show: 'This now contains your independent transcript stream!'.
sw name: 'NewName'.

But this doesn't affect the label. You also have "named" in the sense of:  
the variable "t" refers to that transcript now. So, in your code it's  
"named" t.

> Anyway, no big deal. Scott's method is simple and what I needed. I was  
> just curious about the halos (which I haven't used much, yet.)

There's a sort-of wall between Etoys and the rest of Smalltalk. You can do  
a lot of things easily in Etoys and then hit a wall where straight  
Smalltalk code would be easier. But then, you don't necessarily want to  
give up all the easy stuff in Etoys.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners