Customize OS X App

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

Customize OS X App

demarey
 
Hi,

Would it be possible to ship OpenSmalltalk vm with a customizable menu?
For example, OpenSmalltalk VM for Pharo looks like this picture:
https://files.manuscript.com/b1be8c588900d4609da9b5456dbede880a3304ee3933dfd1074c1352fb96e228/ATT/4699/Screen%20Shot%202018-06-09%20at%2017.50.44.png?AWSAccessKeyId=AKIAIIHTTVUGFAFAHRWQ&Expires=1538141505&response-content-disposition=inline%3B%20filename%3D%22Screen%20Shot%202018-06-09%20at%2017.50.44.png%22%3B%20filename%2A%3DUTF-8%27%27Screen%2520Shot%25202018-06-09%2520at%252017.50.44.png&response-content-type=image%2Fpng&Signature=w3Ddt9Wpq%2BQdcVpqdVx5kJuvEzU%3D

It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
It will also be useful to package end-user applications by allowing developers to customize the application menu.

Regards,
Christophe.
Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

Eliot Miranda-2
 
Hi Christophe,

    I can't see any image in  your mail.  Can you repost?  I'm attaching the source of the menu.  What kinds of customization would you like to see?  hat changes to the menu would you like to see?  One of the issues would be that it may not be possible to resign the executable if the app's Contents/Resources/English.lproj/MainMenu.nib is modified. So it is preferable to get the menu right in the base build.

On Fri, Sep 28, 2018 at 6:40 AM Christophe Demarey <[hidden email]> wrote:
 
Hi,

Would it be possible to ship OpenSmalltalk vm with a customizable menu?
For example, OpenSmalltalk VM for Pharo looks like this picture:
https://files.manuscript.com/b1be8c588900d4609da9b5456dbede880a3304ee3933dfd1074c1352fb96e228/ATT/4699/Screen%20Shot%202018-06-09%20at%2017.50.44.png?AWSAccessKeyId=AKIAIIHTTVUGFAFAHRWQ&Expires=1538141505&response-content-disposition=inline%3B%20filename%3D%22Screen%20Shot%202018-06-09%20at%2017.50.44.png%22%3B%20filename%2A%3DUTF-8%27%27Screen%2520Shot%25202018-06-09%2520at%252017.50.44.png&response-content-type=image%2Fpng&Signature=w3Ddt9Wpq%2BQdcVpqdVx5kJuvEzU%3D

It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
It will also be useful to package end-user applications by allowing developers to customize the application menu.

Regards,
Christophe.


--
_,,,^..^,,,_
best, Eliot

MainMenu.xib (73K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

johnmci
In reply to this post by demarey
 
When the Smalltalk starts up you can use the objective-c plugin or perhaps the menu plugin (depends on if still supported) to alter the menu bar as you see fit.


Sent from my iPhone

On Sep 28, 2018, at 06:40, Christophe Demarey <[hidden email]> wrote:

Hi,

Would it be possible to ship OpenSmalltalk vm with a customizable menu?
For example, OpenSmalltalk VM for Pharo looks like this picture:
https://files.manuscript.com/b1be8c588900d4609da9b5456dbede880a3304ee3933dfd1074c1352fb96e228/ATT/4699/Screen%20Shot%202018-06-09%20at%2017.50.44.png?AWSAccessKeyId=AKIAIIHTTVUGFAFAHRWQ&Expires=1538141505&response-content-disposition=inline%3B%20filename%3D%22Screen%20Shot%202018-06-09%20at%2017.50.44.png%22%3B%20filename%2A%3DUTF-8%27%27Screen%2520Shot%25202018-06-09%2520at%252017.50.44.png&response-content-type=image%2Fpng&Signature=w3Ddt9Wpq%2BQdcVpqdVx5kJuvEzU%3D

It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
It will also be useful to package end-user applications by allowing developers to customize the application menu.

Regards,
Christophe.
Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

Eliot Miranda-2
 
Hi John,
On Fri, Sep 28, 2018 at 10:57 AM John McIntosh <[hidden email]> wrote:
 
When the Smalltalk starts up you can use the objective-c plugin or perhaps the menu plugin (depends on if still supported) to alter the menu bar as you see fit.

Can you give more details?
 


Sent from my iPhone

On Sep 28, 2018, at 06:40, Christophe Demarey <[hidden email]> wrote:

Hi,

Would it be possible to ship OpenSmalltalk vm with a customizable menu?
For example, OpenSmalltalk VM for Pharo looks like this picture:
https://files.manuscript.com/b1be8c588900d4609da9b5456dbede880a3304ee3933dfd1074c1352fb96e228/ATT/4699/Screen%20Shot%202018-06-09%20at%2017.50.44.png?AWSAccessKeyId=AKIAIIHTTVUGFAFAHRWQ&Expires=1538141505&response-content-disposition=inline%3B%20filename%3D%22Screen%20Shot%202018-06-09%20at%2017.50.44.png%22%3B%20filename%2A%3DUTF-8%27%27Screen%2520Shot%25202018-06-09%2520at%252017.50.44.png&response-content-type=image%2Fpng&Signature=w3Ddt9Wpq%2BQdcVpqdVx5kJuvEzU%3D

It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
It will also be useful to package end-user applications by allowing developers to customize the application menu.

Regards,
Christophe.


--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

johnmci
 
Well there is or was a mac menu bar plugin


you'll need to ensure your vm bundle contains that.  I can't say where the smalltalk code you use to talk to it is, nor can I say how you would build the VM with that included. 

---------------

Otherwise you need a VM that has the ObjectiveCPlugin plugin  which I see the pharo people compile. 

https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/ObjectiveCPlugin/ObjectiveCPlugin.c


Then you need the smalltalk code

http://www.squeaksource.com/ObjectiveCBridge2.html



Then consider Apple's documentation 


Perhaps someone has written the Smalltalk code to interface to NSMenu ? 


On Fri, Sep 28, 2018 at 11:05 AM, Eliot Miranda <[hidden email]> wrote:

>
>  
> Hi John,
> On Fri, Sep 28, 2018 at 10:57 AM John McIntosh <[hidden email]> wrote:
>>
>>  
>> When the Smalltalk starts up you can use the objective-c plugin or perhaps the menu plugin (depends on if still supported) to alter the menu bar as you see fit.
>
>
> Can you give more details?
>  
>>
>>
>>
>> Sent from my iPhone
>>
>> On Sep 28, 2018, at 06:40, Christophe Demarey <[hidden email]> wrote:
>>
>> Hi,
>>
>> Would it be possible to ship OpenSmalltalk vm with a customizable menu?
>> For example, OpenSmalltalk VM for Pharo looks like this picture:
>>
>> It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
>> It will also be useful to package end-user applications by allowing developers to customize the application menu.
>>
>> Regards,
>> Christophe.
>
>
>
> --
> _,,,^..^,,,_
> best, Eliot
>



--
===========================================================================
John M. McIntosh. Corporate Smalltalk Consulting Ltd https://www.linkedin.com/in/smalltalk
===========================================================================
Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

Javier Diaz-Reinoso
 
I am using the mac menu plugin in SqPronterface, I have a screenshot of running in a iBook PPC:

https://sourceforge.net/projects/sqpronterface/

but because I am interested in running in old PPC macs I use the old interpreter, not tested with Cog.

On 28 Sep 2018, at 14:38, John McIntosh <[hidden email]> wrote:

Well there is or was a mac menu bar plugin


you'll need to ensure your vm bundle contains that.  I can't say where the smalltalk code you use to talk to it is, nor can I say how you would build the VM with that included. 

---------------

Otherwise you need a VM that has the ObjectiveCPlugin plugin  which I see the pharo people compile. 

https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/ObjectiveCPlugin/ObjectiveCPlugin.c


Then you need the smalltalk code

http://www.squeaksource.com/ObjectiveCBridge2.html



Then consider Apple's documentation 


Perhaps someone has written the Smalltalk code to interface to NSMenu ? 


On Fri, Sep 28, 2018 at 11:05 AM, Eliot Miranda <[hidden email]> wrote:

>
>  
> Hi John,
> On Fri, Sep 28, 2018 at 10:57 AM John McIntosh <[hidden email]> wrote:
>>
>>  
>> When the Smalltalk starts up you can use the objective-c plugin or perhaps the menu plugin (depends on if still supported) to alter the menu bar as you see fit.
>
>
> Can you give more details?
>  
>>
>>
>>
>> Sent from my iPhone
>>
>> On Sep 28, 2018, at 06:40, Christophe Demarey <[hidden email]> wrote:
>>
>> Hi,
>>
>> Would it be possible to ship OpenSmalltalk vm with a customizable menu?
>> For example, OpenSmalltalk VM for Pharo looks like this picture:
>>
>> It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
>> It will also be useful to package end-user applications by allowing developers to customize the application menu.
>>
>> Regards,
>> Christophe.
>
>
>
> --
> _,,,^..^,,,_
> best, Eliot
>



--
===========================================================================
John M. McIntosh. Corporate Smalltalk Consulting Ltd https://www.linkedin.com/in/smalltalk
===========================================================================

Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

demarey
In reply to this post by Eliot Miranda-2
 
Hi Eliot,

Here is the image as attachment.



At least, I would like the ability to replace SqueakOSXApp spread over all the menus (I think it is the same property that is used at different places).
It would be nice to also add new menu items but I think it is more difficult because the VM needs ti be aware of these new items to handle them.

Yes, signing could be an issue for apps. it should work if the app is also signed (I mean re-sign everything. We do that for Pharo Launcher).
I agree it is best to have it right in the base build.

Le 28 sept. 2018 à 19:52, Eliot Miranda <[hidden email]> a écrit :

Hi Christophe,

    I can't see any image in  your mail.  Can you repost?  I'm attaching the source of the menu.  What kinds of customization would you like to see?  hat changes to the menu would you like to see?  One of the issues would be that it may not be possible to resign the executable if the app's Contents/Resources/English.lproj/MainMenu.nib is modified. So it is preferable to get the menu right in the base build.

On Fri, Sep 28, 2018 at 6:40 AM Christophe Demarey <[hidden email]> wrote:
 
Hi,

Would it be possible to ship OpenSmalltalk vm with a customizable menu?
For example, OpenSmalltalk VM for Pharo looks like this picture:
https://files.manuscript.com/b1be8c588900d4609da9b5456dbede880a3304ee3933dfd1074c1352fb96e228/ATT/4699/Screen%20Shot%202018-06-09%20at%2017.50.44.png?AWSAccessKeyId=AKIAIIHTTVUGFAFAHRWQ&Expires=1538141505&response-content-disposition=inline%3B%20filename%3D%22Screen%20Shot%202018-06-09%20at%2017.50.44.png%22%3B%20filename%2A%3DUTF-8%27%27Screen%2520Shot%25202018-06-09%2520at%252017.50.44.png&response-content-type=image%2Fpng&Signature=w3Ddt9Wpq%2BQdcVpqdVx5kJuvEzU%3D

It is very strange for users. Would it be possible to have a way to customize menu entries? I think this part is encoded in MainMenu.nib.
It will also be useful to package end-user applications by allowing developers to customize the application menu.

Regards,
Christophe.


--
_,,,^..^,,,_
best, Eliot
<MainMenu.xib>

Reply | Threaded
Open this post in threaded view
|

Re: Customize OS X App

demarey
In reply to this post by johnmci
 
Hi John,

Le 28 sept. 2018 à 21:38, John McIntosh <[hidden email]> a écrit :

Well there is or was a mac menu bar plugin


you'll need to ensure your vm bundle contains that.  I can't say where the smalltalk code you use to talk to it is, nor can I say how you would build the VM with that included. 

Good to know. I was not aware of that plugin.

---------------

Otherwise you need a VM that has the ObjectiveCPlugin plugin  which I see the pharo people compile. 

https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/ObjectiveCPlugin/ObjectiveCPlugin.c


Then you need the smalltalk code

http://www.squeaksource.com/ObjectiveCBridge2.html



Then consider Apple's documentation 


Perhaps someone has written the Smalltalk code to interface to NSMenu ? 

A few months ago, I did some experiments with Alien-MacOSX in Pharo (http://squeaksource.com/Alien).
It was not very successful. I was able to remove menus or menu items but I did not succeed to update existing ones or to create new ones.

Some snippet of my experiments:

nsApp := #NSApplication inObjectiveC sharedApplication.
menu := nsApp mainMenu.

menu removeItemAtIndex: 2. "remove Edit menu item"  => ok

menu addItemWithTitle: 'Quit' asNSString autorelease 
        action: #terminate: asObjectiveCSelector
        keyEquivalent: 'q' asNSString autorelease.  => does not work

#NSMenu inObjectiveC setMenuBarVisible: 0.
#NSMenu inObjectiveC setMenuBarVisible: true asAlien.


Probably I did not succeed probably because I do not know enough on OS X app dev.

It could be an option, but I still think that it would be bettter to be able to customize this static information in the nib file.

Thanks,
Christophe