Hi,
(how) can one add a new button to GTPlayground, next to the "do it all and go" and "remote publish"?
I want to add integration with Gists (because I find the remote publish only remotely useful), however it seems that the buttons are hard coded.
Thanks, Peter
GTPlayground>>#codeIn: builds the buttons
-----Original Message----- From: Moose-dev [mailto:moose-dev-bounces@list.inf.unibe.ch] On Behalf Of Peter Uhnak Sent: Saturday, August 27, 2016 5:43 PM To: Moose-related development moose-dev@list.inf.unibe.ch Subject: [Moose-dev] Custom button in GTPlayground
Hi,
(how) can one add a new button to GTPlayground, next to the "do it all and go" and "remote publish"?
I want to add integration with Gists (because I find the remote publish only remotely useful), however it seems that the buttons are hard coded.
Thanks, Peter _______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
On 27 Aug 2016, at 19:09, Peter Uhnak i.uhnak@gmail.com wrote:
On Sat, Aug 27, 2016 at 04:16:17PM +0000, Henrik Nergaard wrote:
GTPlayground>>#codeIn: builds the buttons
As I've said:
however it seems that the buttons are hard coded.
I don't see how I can add them without changing the source code.
<troll-mode>
use metalinks ;)
</troll-mode>
Peter _______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Inspector is just a Morph. Button is also just a Morph :)
so it would be very simple, for example (generated randomly, just to show the idea)
inspector submorphs second submorphs first submorphs third submorphs first
submorphs second addMorphBack: button.
Cheers, Alex
On 27 August 2016 at 21:05, Yuriy Tymchuk yuriy.tymchuk@me.com wrote:
On 27 Aug 2016, at 19:09, Peter Uhnak i.uhnak@gmail.com wrote:
On Sat, Aug 27, 2016 at 04:16:17PM +0000, Henrik Nergaard wrote:
GTPlayground>>#codeIn: builds the buttons
As I've said:
however it seems that the buttons are hard coded.
I don't see how I can add them without changing the source code.
<troll-mode>
use metalinks ;)
</troll-mode>
Peter _______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
On Sat, Aug 27, 2016 at 09:13:49PM +0200, Aliaksei Syrel wrote:
Inspector is just a Morph. Button is also just a Morph :)
so it would be very simple, for example (generated randomly, just to show the idea)
inspector submorphs second submorphs first submorphs third submorphs first submorphs second addMorphBack: button.
Demeter is rolling in her grave. :-D
I'll go with metalinks... :)
Thanks, Peter
On 27 Aug 2016, at 21:13, Aliaksei Syrel alex.syrel@gmail.com wrote:
Inspector is just a Morph. Button is also just a Morph :)
so it would be very simple, for example (generated randomly, just to show the idea)
inspector submorphs second submorphs first submorphs third submorphs first submorphs second addMorphBack: button.
if one day I accept a code like this in the image… please, fire me… I will understand it.
:P
Cheers, Alex
On 27 August 2016 at 21:05, Yuriy Tymchuk <yuriy.tymchuk@me.com mailto:yuriy.tymchuk@me.com> wrote:
On 27 Aug 2016, at 19:09, Peter Uhnak <i.uhnak@gmail.com mailto:i.uhnak@gmail.com> wrote:
On Sat, Aug 27, 2016 at 04:16:17PM +0000, Henrik Nergaard wrote:
GTPlayground>>#codeIn: builds the buttons
As I've said:
however it seems that the buttons are hard coded.
I don't see how I can add them without changing the source code.
<troll-mode>
use metalinks ;)
</troll-mode>
Peter _______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch mailto:Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch mailto:Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
On Sat, Aug 27, 2016 at 09:05:24PM +0200, Yuriy Tymchuk wrote:
On 27 Aug 2016, at 19:09, Peter Uhnak i.uhnak@gmail.com wrote:
On Sat, Aug 27, 2016 at 04:16:17PM +0000, Henrik Nergaard wrote:
GTPlayground>>#codeIn: builds the buttons
As I've said:
however it seems that the buttons are hard coded.
I don't see how I can add them without changing the source code.
<troll-mode>
use metalinks ;)
</troll-mode>
Oh! You've just solved my problems with unloading code when I do custom overrides from startup scripts... :-D
Hi Peter.
Right now you can only add an action to the context menu by adding to the class side of GTPlayground a method annotated with <playgroundContextMenu> that takes a parameter and returns a list of glamour actions. The parameter will be the actual instance of the playground. You can find an example in #contextMenuBasicActionsFor:
GTPlayground class>>#customActions: aPlayground <playgroundContextMenu> ^ { GLMGenericAction new action: [ self inform: 'action' ]; icon: GLMUIThemeExtraIcons glamorousBrowse; title: 'Action' }
Indeed we should have a similar option for customizing the buttons from the toolbar. https://pharo.fogbugz.com/f/cases/19008/GTPlaygroung-should-offer-a-solution...
Cheers, Andrei
On Sat, Aug 27, 2016 at 5:42 PM, Peter Uhnak i.uhnak@gmail.com wrote:
Hi,
(how) can one add a new button to GTPlayground, next to the "do it all and go" and "remote publish"?
I want to add integration with Gists (because I find the remote publish only remotely useful), however it seems that the buttons are hard coded.
Thanks, Peter _______________________________________________ Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
On Mon, Aug 29, 2016 at 12:26 PM, Andrei Chis chisvasileandrei@gmail.com wrote:
Hi Peter.
Right now you can only add an action to the context menu by adding to the class side of GTPlayground a method annotated with <playgroundContextMenu> that takes a parameter and returns a list of glamour actions. The parameter will be the actual instance of the playground. You can find an example in #contextMenuBasicActionsFor:
GTPlayground class>>#customActions: aPlayground
<playgroundContextMenu> ^ { GLMGenericAction new action: [ self inform: 'action' ]; icon: GLMUIThemeExtraIcons glamorousBrowse; title: 'Action' }
Thanks, this is a good non-hacky solution for now. (besides, I am not going to use it that often so maybe it's better to be hidden in context menu).
Thanks!
Peter