Class Comment Browser

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

Class Comment Browser

Dan Norton
Hi Juan,

A little help, please. BrowserWindow uses CodeWindow>>buildMorphicCodePane for the
class comment area. Although this area looks like text, expressions appearing in class
comments can be executed as in a workspace.

I want the same behavior in Class Comment Browser, but all I get is text behavior (no
execution). How can this be changed?

 - Dan

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Class Comment Browser

Juan Vuletich-4
Hi Dan,

See the TextEditor hierarchy. See #editorClass, senders and implementors.
It is the model who decides what kind of editor to use.

An easy way to find out about this, is to realiza that what you want is
the "Smalltalk Options" menu in code panes. Just write "Smalltalk Options"
in some code pane, select it (without the quotes) and do right click /
Smalltalk Options / Method Source with it. That leads you right to
SmalltalkEditor.

Cheers,
Juan Vuletich

On Tue, September 29, 2015 11:35 pm, Dan Norton wrote:

> Hi Juan,
>
>
> A little help, please. BrowserWindow uses
> CodeWindow>>buildMorphicCodePane for the
> class comment area. Although this area looks like text, expressions
> appearing in class comments can be executed as in a workspace.
>
> I want the same behavior in Class Comment Browser, but all I get is text
> behavior (no execution). How can this be changed?
>
> - Dan
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Class Comment Browser

Dan Norton
Hi Juan,

The editor class seems to remain constant as SmalltalkEditor. To see what is puzzling:

  open a browser on a class with an actual comment
  view the class comment (? button)
  select all of the comment and copy it
  select, then deselect a message category
  paste the comment in the code window as if defining a new method
  see the difference in presentation

What is making this switch? If I knew where this is done I might get the behavior I want in
CCB.

 - Dan

On 30 Sep 2015 at 8:19, Juan Vuletich wrote:

> Hi Dan,
>
> See the TextEditor hierarchy. See #editorClass, senders and
> implementors.
> It is the model who decides what kind of editor to use.
>
> An easy way to find out about this, is to realiza that what you want
> is
> the "Smalltalk Options" menu in code panes. Just write "Smalltalk
> Options"
> in some code pane, select it (without the quotes) and do right click
> /
> Smalltalk Options / Method Source with it. That leads you right to
> SmalltalkEditor.
>
> Cheers,
> Juan Vuletich
>
> On Tue, September 29, 2015 11:35 pm, Dan Norton wrote:
> > Hi Juan,
> >
> >
> > A little help, please. BrowserWindow uses
> > CodeWindow>>buildMorphicCodePane for the
> > class comment area. Although this area looks like text,
> expressions
> > appearing in class comments can be executed as in a workspace.
> >
> > I want the same behavior in Class Comment Browser, but all I get
> is text
> > behavior (no execution). How can this be changed?
> >
> > - Dan
> >
> >
> > _______________________________________________
> > Cuis mailing list
> > [hidden email]
> > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
> >
> >
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org



_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Class Comment Browser

Juan Vuletich-4
Hi Dan,

Apologies for the long delay in answering.

I think you mean the text styler, that colorizes Smalltalk code, right?
Well, an instance of InnerTextMorph might have a subinstance of
SHTextStyler in the 'styler' variable. This is "Shout", originally from
Squeak. But it might be disabled sometimes, as when the code pane is
showing diffs, or bytecodes, etc. See #okToStyle , where the model is
asked whether it is appropriate to style each time.

If you can't solve the problem, point me to the latest version of CCB,
and briefly describe steps, expected behavior, unwanted behavior (to be
sure I understand), and I'll take a look.

Cheers,
Juan Vuletich

On 30/09/2015 06:45 p.m., Dan Norton wrote:

> Hi Juan,
>
> The editor class seems to remain constant as SmalltalkEditor. To see what is puzzling:
>
>    open a browser on a class with an actual comment
>    view the class comment (? button)
>    select all of the comment and copy it
>    select, then deselect a message category
>    paste the comment in the code window as if defining a new method
>    see the difference in presentation
>
> What is making this switch? If I knew where this is done I might get the behavior I want in
> CCB.
>
>   - Dan
>
> On 30 Sep 2015 at 8:19, Juan Vuletich wrote:
>
>> Hi Dan,
>>
>> See the TextEditor hierarchy. See #editorClass, senders and
>> implementors.
>> It is the model who decides what kind of editor to use.
>>
>> An easy way to find out about this, is to realiza that what you want
>> is
>> the "Smalltalk Options" menu in code panes. Just write "Smalltalk
>> Options"
>> in some code pane, select it (without the quotes) and do right click
>> /
>> Smalltalk Options / Method Source with it. That leads you right to
>> SmalltalkEditor.
>>
>> Cheers,
>> Juan Vuletich
>>
>> On Tue, September 29, 2015 11:35 pm, Dan Norton wrote:
>>> Hi Juan,
>>>
>>>
>>> A little help, please. BrowserWindow uses
>>> CodeWindow>>buildMorphicCodePane for the
>>> class comment area. Although this area looks like text,
>> expressions
>>> appearing in class comments can be executed as in a workspace.
>>>
>>> I want the same behavior in Class Comment Browser, but all I get
>> is text
>>> behavior (no execution). How can this be changed?
>>>
>>> - Dan
>>>
>>>
>>> _______________________________________________
>>> Cuis mailing list
>>> [hidden email]
>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>>
>>>
>>
>> _______________________________________________
>> Cuis mailing list
>> [hidden email]
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Class Comment Browser

Dan Norton
Hi Juan,

Delay? What delay? Not to worry :-) I regret that this problem is either beyond me or I'm blind
to it.

Had to clean up the act a bit because of all the fruitless experiments but the repo seems to
behave OK. It is strongly desired by the (huge?) user community that the pane containing the
comment would behave like a work space, e.g. allow statements to be executed and names
to be highlighted and used to open a browser. The repo is:

        https://github.com/dhnorton/Cuis-Smalltalk-comments

Please let me know what I need to do.

 - Dan

On 6 Oct 2015 at 9:24, Juan Vuletich wrote:

> Hi Dan,
>
> Apologies for the long delay in answering.
>
> I think you mean the text styler, that colorizes Smalltalk code,
> right?
> Well, an instance of InnerTextMorph might have a subinstance of
> SHTextStyler in the 'styler' variable. This is "Shout", originally
> from
> Squeak. But it might be disabled sometimes, as when the code pane is
> showing diffs, or bytecodes, etc. See #okToStyle , where the model
> is
> asked whether it is appropriate to style each time.
>
> If you can't solve the problem, point me to the latest version of
> CCB,
> and briefly describe steps, expected behavior, unwanted behavior (to
> be
> sure I understand), and I'll take a look.
>
> Cheers,
> Juan Vuletich
>
> On 30/09/2015 06:45 p.m., Dan Norton wrote:
> > Hi Juan,
> >
> > The editor class seems to remain constant as SmalltalkEditor. To
> see what is puzzling:
> >
> >    open a browser on a class with an actual comment
> >    view the class comment (? button)
> >    select all of the comment and copy it
> >    select, then deselect a message category
> >    paste the comment in the code window as if defining a new
> method
> >    see the difference in presentation
> >
> > What is making this switch? If I knew where this is done I might
> get the behavior I want in
> > CCB.
> >
> >   - Dan
> >
> > On 30 Sep 2015 at 8:19, Juan Vuletich wrote:
> >
> >> Hi Dan,
> >>
> >> See the TextEditor hierarchy. See #editorClass, senders and
> >> implementors.
> >> It is the model who decides what kind of editor to use.
> >>
> >> An easy way to find out about this, is to realiza that what you
> want
> >> is
> >> the "Smalltalk Options" menu in code panes. Just write
> "Smalltalk
> >> Options"
> >> in some code pane, select it (without the quotes) and do right
> click
> >> /
> >> Smalltalk Options / Method Source with it. That leads you right
> to
> >> SmalltalkEditor.
> >>
> >> Cheers,
> >> Juan Vuletich
> >>
> >> On Tue, September 29, 2015 11:35 pm, Dan Norton wrote:
> >>> Hi Juan,
> >>>
> >>>
> >>> A little help, please. BrowserWindow uses
> >>> CodeWindow>>buildMorphicCodePane for the
> >>> class comment area. Although this area looks like text,
> >> expressions
> >>> appearing in class comments can be executed as in a workspace.
> >>>
> >>> I want the same behavior in Class Comment Browser, but all I
> get
> >> is text
> >>> behavior (no execution). How can this be changed?
> >>>
> >>> - Dan
> >>>
> >>>
> >>> _______________________________________________
> >>> Cuis mailing list
> >>> [hidden email]
> >>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
> >>>
> >>>
> >>
> >> _______________________________________________
> >> Cuis mailing list
> >> [hidden email]
> >> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
> >
> >
> > _______________________________________________
> > Cuis mailing list
> > [hidden email]
> > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
> >
>



_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: Class Comment Browser

Juan Vuletich-4
Hi Dan,

If you inspect the InnerTextMorph in your right pane, it has:
editor: aTextEditor
styler: nil
To be able to evaluate code, you need a SmalltalkEditor. This does the trick:

CommentGuide >> editorClassFor: textGetter
        ^SmalltalkEditor

If you also want Workspace like syntax highlighting, you need a
TextStyler. Add:

CommentGuide >> textStylerClassFor: textGetter
        ^SHTextStylerST80

CommentGuide >> shoutAboutToStyle: aSHTextStyler
        ^true

Keep in mind that most class comments can not be parsed as code! That's
why in the regular browser, methods are syntaxHighlighted, but class
comments are not.

I feel that with the hints I gave you before, you could have found out all
this yourself. You will get the most out of Smalltalk if you use the code
inspection tools as much as possible, and you are not afraid of exploring,
experimenting, and trying to learn how the system works.

Cheers,
Juan Vuletich

On Tue, October 6, 2015 10:17 pm, Dan Norton wrote:

> Hi Juan,
>
>
> Delay? What delay? Not to worry :-) I regret that this problem is either
> beyond me or I'm blind to it.
>
> Had to clean up the act a bit because of all the fruitless experiments
> but the repo seems to behave OK. It is strongly desired by the (huge?)
> user community that the pane containing the comment would behave like a
> work space, e.g. allow statements to be executed and names to be
> highlighted and used to open a browser. The repo is:
>
> https://github.com/dhnorton/Cuis-Smalltalk-comments
>
>
> Please let me know what I need to do.
>
>
> - Dan
>
>
> On 6 Oct 2015 at 9:24, Juan Vuletich wrote:
>
>
>> Hi Dan,
>>
>>
>> Apologies for the long delay in answering.
>>
>>
>> I think you mean the text styler, that colorizes Smalltalk code,
>> right? Well, an instance of InnerTextMorph might have a subinstance of
>> SHTextStyler in the 'styler' variable. This is "Shout", originally
>> from Squeak. But it might be disabled sometimes, as when the code pane is
>>  showing diffs, or bytecodes, etc. See #okToStyle , where the model is
>> asked whether it is appropriate to style each time.
>>
>> If you can't solve the problem, point me to the latest version of
>> CCB,
>> and briefly describe steps, expected behavior, unwanted behavior (to be
>> sure I understand), and I'll take a look.
>>
>> Cheers,
>> Juan Vuletich
>>
>>
>> On 30/09/2015 06:45 p.m., Dan Norton wrote:
>>
>>> Hi Juan,
>>>
>>>
>>> The editor class seems to remain constant as SmalltalkEditor. To
>>>
>> see what is puzzling:
>>>
>>> open a browser on a class with an actual comment view the class
>>> comment (? button) select all of the comment and copy it select, then
>>> deselect a message category paste the comment in the code window as if
>>> defining a new
>> method
>>> see the difference in presentation
>>>
>>> What is making this switch? If I knew where this is done I might
>>>
>> get the behavior I want in
>>> CCB.
>>>
>>>
>>> - Dan
>>>
>>>
>>> On 30 Sep 2015 at 8:19, Juan Vuletich wrote:
>>>
>>>
>>>> Hi Dan,
>>>>
>>>>
>>>> See the TextEditor hierarchy. See #editorClass, senders and
>>>> implementors. It is the model who decides what kind of editor to use.
>>>>
>>>>
>>>> An easy way to find out about this, is to realiza that what you
>>>>
>> want
>>>> is the "Smalltalk Options" menu in code panes. Just write
>> "Smalltalk
>>
>>>> Options"
>>>> in some code pane, select it (without the quotes) and do right
>> click
>>>> /
>>>> Smalltalk Options / Method Source with it. That leads you right
>>>>
>> to
>>>> SmalltalkEditor.
>>>>
>>>>
>>>> Cheers,
>>>> Juan Vuletich
>>>>
>>>>
>>>> On Tue, September 29, 2015 11:35 pm, Dan Norton wrote:
>>>>
>>>>> Hi Juan,
>>>>>
>>>>>
>>>>>
>>>>> A little help, please. BrowserWindow uses
>>>>> CodeWindow>>buildMorphicCodePane for the
>>>>> class comment area. Although this area looks like text,
>>>> expressions
>>>>> appearing in class comments can be executed as in a workspace.
>>>>>
>>>>> I want the same behavior in Class Comment Browser, but all I
>>>>>
>> get
>>>> is text
>>>>> behavior (no execution). How can this be changed?
>>>>>
>>>>> - Dan
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Cuis mailing list
>>>>> [hidden email]
>>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>>>>
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Cuis mailing list
>>>> [hidden email]
>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>>>
>>>
>>>
>>> _______________________________________________
>>> Cuis mailing list
>>> [hidden email]
>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>>
>>>
>>
>
>
>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org