[Pharo-dev] [Pharo Trick: #0004] - Run code using a key command to speedup development

Guillermo Polito guillermopolito at gmail.com
Thu Dec 12 05:02:10 EST 2013


Ahh a little detail!

We are deprecating the usage of #on:do: for shortcuts so they are not
mistaken with exception handling, nor announcement registration :).

The right snippet would be

   World
      bindKeyCombination: $a shift command
      toAction: [ Object browse ].

Actually, if you see the #on:do: implementation in Morph, you'll notice it
uses #bindKeyCombination:toAction: .
Aaaand, we should probably remove/deprecate the old one.


On Thu, Dec 12, 2013 at 10:02 AM, phil at highoctane.be <phil at highoctane.be>wrote:

> Very sweet indeed.
>
> Phil
>
>
>
> On Thu, Dec 12, 2013 at 9:42 AM, Max Leske <maxleske at gmail.com> wrote:
>
>> Nice! Didn’t know about that one.
>>
>>
>> On 12.12.2013, at 09:35, Torsten Bergmann <astares at gmx.de> wrote:
>>
>> >
>> -----------------------------------------------------------------------------------
>> > [Pharo Trick: #0004] - Run code using a key command to speedup
>> development
>> >
>> -----------------------------------------------------------------------------------
>> > Works in: Pharo3.0 Latest update: #30637 but should work in other
>> 2.0/3.0 versions
>> >
>> -----------------------------------------------------------------------------------
>> >
>> > If you have to run some code very often you typically have to evaluate
>> it
>> > from a workspace over and over again.
>> > But to speed up you can assign a global keymapping which allows to run
>> it with
>> > a simple keyboard shortcut:
>> >
>> >   World
>> >      on: $a shift command
>> >      do: [ Object browse ].
>> >
>> > Evaluate this once in a workspace. After that anytime you press SHIFT,
>> the
>> > command button (on Windows this is ALT) and A together the block gets
>> evaluated
>> > and your code runs easily.
>> >
>> > Background:
>> > ===========
>> > In Pharo there is a global morph called "World" representing the
>> desktop.
>> > One can assign a key combination to any morph including this world.
>> > If you are interested on the Keymappings then read
>> http://playingwithobjects.wordpress.com/2013/03/19/keymappings-101-for-pharo-2-0/
>> > for more
>> >
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131212/0fa9bad3/attachment-0002.html>


More information about the Pharo-dev mailing list