About customizing Squeak -> custom world menu?

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

About customizing Squeak -> custom world menu?

Hannes Hirzel
Hello

The wiki page
      "Customizing the Squeak UI"
      http://wiki.squeak.org/squeak/1008

refers to instructions how to create your custom world menu by referring to page

      "Subclassing MorphicProject, TheWorldMenu and PasteUpMorph"
      http://wiki.squeak.org/squeak/6461

The instructions on that page work fine.  Are there simpler ways to
create a customized world menu and hook it up as a parameter to a
MorphicProject?

Regards
Hannes

Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Hannes Hirzel
P.S. Ideally through a project preference

      http://wiki.squeak.org/squeak/704

to be set individually for a particular project.

On 2/24/18, H. Hirzel <[hidden email]> wrote:

> Hello
>
> The wiki page
>       "Customizing the Squeak UI"
>       http://wiki.squeak.org/squeak/1008
>
> refers to instructions how to create your custom world menu by referring to
> page
>
>       "Subclassing MorphicProject, TheWorldMenu and PasteUpMorph"
>       http://wiki.squeak.org/squeak/6461
>
> The instructions on that page work fine.  Are there simpler ways to
> create a customized world menu and hook it up as a parameter to a
> MorphicProject?
>
> Regards
> Hannes
>

Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Hannes Hirzel
P.S. 2

The issue could be resolved easily if

PasteUpMorph
buildWorldMenu: evt
        ^(TheWorldMenu new
                world: self
                project: (self project ifNil: [Project current])       "mvc??"
                hand: evt hand) buildWorldMenu.

would NOT have hard coded TheWorldMenu.

On 2/24/18, H. Hirzel <[hidden email]> wrote:

> P.S. Ideally through a project preference
>
>       http://wiki.squeak.org/squeak/704
>
> to be set individually for a particular project.
>
> On 2/24/18, H. Hirzel <[hidden email]> wrote:
>> Hello
>>
>> The wiki page
>>       "Customizing the Squeak UI"
>>       http://wiki.squeak.org/squeak/1008
>>
>> refers to instructions how to create your custom world menu by referring
>> to
>> page
>>
>>       "Subclassing MorphicProject, TheWorldMenu and PasteUpMorph"
>>       http://wiki.squeak.org/squeak/6461
>>
>> The instructions on that page work fine.  Are there simpler ways to
>> create a customized world menu and hook it up as a parameter to a
>> MorphicProject?
>>
>> Regards
>> Hannes
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Bob Arning-2

or if #buildWorldMenu were not hardcoded

or if TheWorldMenu decided to query the project for an alternate method

all of which is easy enough for one to implement


On 2/24/18 7:15 AM, H. Hirzel wrote:
P.S. 2

The issue could be resolved easily if

PasteUpMorph
buildWorldMenu: evt
	^(TheWorldMenu new
		world: self
		project: (self project ifNil: [Project current])       "mvc??"
		hand: evt hand) buildWorldMenu.

would NOT have hard coded TheWorldMenu.

On 2/24/18, H. Hirzel [hidden email] wrote:
P.S. Ideally through a project preference

      http://wiki.squeak.org/squeak/704

to be set individually for a particular project.

On 2/24/18, H. Hirzel [hidden email] wrote:
Hello

The wiki page
      "Customizing the Squeak UI"
      http://wiki.squeak.org/squeak/1008

refers to instructions how to create your custom world menu by referring
to
page

      "Subclassing MorphicProject, TheWorldMenu and PasteUpMorph"
      http://wiki.squeak.org/squeak/6461

The instructions on that page work fine.  Are there simpler ways to
create a customized world menu and hook it up as a parameter to a
MorphicProject?

Regards
Hannes


      

    



Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Hannes Hirzel
Yes, implementation is easy but my question is how it should be done
in a way that conforms to the intention of the framework code.  A
"recommended good solution".

What about using a project preference?

It needs the method PasteUpMorph buildWorldMenu: evt from May 2000

    buildWorldMenu: evt
        ^(TheWorldMenu new
                world: self
                project: (self project ifNil: [Project current])       "mvc??"
                hand: evt hand) buildWorldMenu.


to be replaced with


        buildWorldMenu: evt
        |project worldMenuClassSymbol|

        project := self project ifNil: [Project current]  "mvc??".

        worldMenuClassSymbol := project
projectPreferenceFlagDictionary at:
#worldMenuClassSymbol ifAbsent: [#TheWorldMenu].

    ^((Smalltalk at:  worldMenuClassSymbol) new
                world: self
                project: project
                hand: evt hand) buildWorldMenu.


Detailed description:     http://wiki.squeak.org/squeak/1047

Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Bob Arning-2

Well, intentions are hard to figure sometimes. Whose intentions? When?

Of course, if you follow things back a step, you might uncover

Preferences personalizedWorldMenu

and see if that satisfies requirements.


On 2/24/18 9:05 AM, H. Hirzel wrote:
Yes, implementation is easy but my question is how it should be done
in a way that conforms to the intention of the framework code.  A
"recommended good solution".

What about using a project preference?

It needs the method PasteUpMorph buildWorldMenu: evt from May 2000

    buildWorldMenu: evt
	^(TheWorldMenu new
		world: self
		project: (self project ifNil: [Project current])       "mvc??"
		hand: evt hand) buildWorldMenu.


to be replaced with


        buildWorldMenu: evt
        |project worldMenuClassSymbol|

        project := self project ifNil: [Project current]  "mvc??".

        worldMenuClassSymbol := project
projectPreferenceFlagDictionary at:
#worldMenuClassSymbol ifAbsent: [#TheWorldMenu].

    ^((Smalltalk at:  worldMenuClassSymbol) new
		world: self
		project: project
		hand: evt hand) buildWorldMenu.


Detailed description:     http://wiki.squeak.org/squeak/1047




Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Bob Arning-2
In reply to this post by Hannes Hirzel

Or you could...

World on: #mouseDown send: #putUpSomeOtherMenu: to: World


On 2/24/18 9:05 AM, H. Hirzel wrote:
Yes, implementation is easy but my question is how it should be done
in a way that conforms to the intention of the framework code.  A
"recommended good solution".

What about using a project preference?

It needs the method PasteUpMorph buildWorldMenu: evt from May 2000

    buildWorldMenu: evt
	^(TheWorldMenu new
		world: self
		project: (self project ifNil: [Project current])       "mvc??"
		hand: evt hand) buildWorldMenu.


to be replaced with


        buildWorldMenu: evt
        |project worldMenuClassSymbol|

        project := self project ifNil: [Project current]  "mvc??".

        worldMenuClassSymbol := project
projectPreferenceFlagDictionary at:
#worldMenuClassSymbol ifAbsent: [#TheWorldMenu].

    ^((Smalltalk at:  worldMenuClassSymbol) new
		world: self
		project: project
		hand: evt hand) buildWorldMenu.


Detailed description:     http://wiki.squeak.org/squeak/1047




Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Hannes Hirzel
In reply to this post by Bob Arning-2
On 2/24/18, Bob Arning <[hidden email]> wrote:
> Well, intentions are hard to figure sometimes. Whose intentions? When?

Yes, different people had different intentions in the last 20 years....

> Of course, if you follow things back a step, you might uncover
>
> Preferences personalizedWorldMenu

Interesting hint .... thank you .... see upcoming new mail thread

> and see if that satisfies requirements.
>
>
> On 2/24/18 9:05 AM, H. Hirzel wrote:
>> Yes, implementation is easy but my question is how it should be done
>> in a way that conforms to the intention of the framework code.  A
>> "recommended good solution".
>>
>> What about using a project preference?
>>
>> It needs the method PasteUpMorph buildWorldMenu: evt from May 2000
>>
>>      buildWorldMenu: evt
>> ^(TheWorldMenu new
>> world: self
>> project: (self project ifNil: [Project current])       "mvc??"
>> hand: evt hand) buildWorldMenu.
>>
>>
>> to be replaced with
>>
>>
>>          buildWorldMenu: evt
>>          |project worldMenuClassSymbol|
>>
>>          project := self project ifNil: [Project current]  "mvc??".
>>
>>          worldMenuClassSymbol := project
>> projectPreferenceFlagDictionary at:
>> #worldMenuClassSymbol ifAbsent: [#TheWorldMenu].
>>
>>      ^((Smalltalk at:  worldMenuClassSymbol) new
>> world: self
>> project: project
>> hand: evt hand) buildWorldMenu.
>>
>>
>> Detailed description:     http://wiki.squeak.org/squeak/1047
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Hannes Hirzel
In reply to this post by Bob Arning-2
On 2/24/18, Bob Arning <[hidden email]> wrote:
> Or you could...
>
> World on: #mouseDown send: #putUpSomeOtherMenu: to: World

This would be a better solution since it does involve adding a method
but not changing a method of the base image.

I tested it with adding #buildWorldMenu4: to PasteUpMorph

    buildWorldMenu4: evt
    |project |

    project := self project ifNil: [Project current]  "mvc??".


    ^(TheWorldMenu4 new
                world: self
                project: project
                hand: evt hand) buildWorldMenu.


I executed
    World on: #mouseDown send: #putUpSomeOtherMenu: to: World

But the new world menu did not come up.

So far

    http://wiki.squeak.org/squeak/1047

is the working solution I found for customizing the red button [1] menu

--Hannes


[1] Red button -- http://wiki.squeak.org/squeak/1904 - usually the
left mouse button.

>
> On 2/24/18 9:05 AM, H. Hirzel wrote:
>> Yes, implementation is easy but my question is how it should be done
>> in a way that conforms to the intention of the framework code.  A
>> "recommended good solution".
>>
>> What about using a project preference?
>>
>> It needs the method PasteUpMorph buildWorldMenu: evt from May 2000
>>
>>      buildWorldMenu: evt
>> ^(TheWorldMenu new
>> world: self
>> project: (self project ifNil: [Project current])       "mvc??"
>> hand: evt hand) buildWorldMenu.
>>
>>
>> to be replaced with
>>
>>
>>          buildWorldMenu: evt
>>          |project worldMenuClassSymbol|
>>
>>          project := self project ifNil: [Project current]  "mvc??".
>>
>>          worldMenuClassSymbol := project
>> projectPreferenceFlagDictionary at:
>> #worldMenuClassSymbol ifAbsent: [#TheWorldMenu].
>>
>>      ^((Smalltalk at:  worldMenuClassSymbol) new
>> world: self
>> project: project
>> hand: evt hand) buildWorldMenu.
>>
>>
>> Detailed description:     http://wiki.squeak.org/squeak/1047
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: About customizing Squeak -> custom world menu?

Bob Arning-2

your method would need to display it after building it -- look at #putUpWorldMenu:  for the missing bits


On 2/24/18 12:18 PM, H. Hirzel wrote:
On 2/24/18, Bob Arning [hidden email] wrote:
Or you could...

World on: #mouseDown send: #putUpSomeOtherMenu: to: World
This would be a better solution since it does involve adding a method
but not changing a method of the base image.

I tested it with adding #buildWorldMenu4: to PasteUpMorph

    buildWorldMenu4: evt
    |project |

    project := self project ifNil: [Project current]  "mvc??".


    ^(TheWorldMenu4 new
		world: self
		project: project
		hand: evt hand) buildWorldMenu.


I executed
    World on: #mouseDown send: #putUpSomeOtherMenu: to: World

But the new world menu did not come up.

So far

    http://wiki.squeak.org/squeak/1047

is the working solution I found for customizing the red button [1] menu

--Hannes


[1] Red button -- http://wiki.squeak.org/squeak/1904 - usually the
left mouse button.

On 2/24/18 9:05 AM, H. Hirzel wrote:
Yes, implementation is easy but my question is how it should be done
in a way that conforms to the intention of the framework code.  A
"recommended good solution".

What about using a project preference?

It needs the method PasteUpMorph buildWorldMenu: evt from May 2000

     buildWorldMenu: evt
	^(TheWorldMenu new
		world: self
		project: (self project ifNil: [Project current])       "mvc??"
		hand: evt hand) buildWorldMenu.


to be replaced with


         buildWorldMenu: evt
         |project worldMenuClassSymbol|

         project := self project ifNil: [Project current]  "mvc??".

         worldMenuClassSymbol := project
projectPreferenceFlagDictionary at:
#worldMenuClassSymbol ifAbsent: [#TheWorldMenu].

     ^((Smalltalk at:  worldMenuClassSymbol) new
		world: self
		project: project
		hand: evt hand) buildWorldMenu.


Detailed description:     http://wiki.squeak.org/squeak/1047