Spec Tree Shortcuts

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

Spec Tree Shortcuts

Camillo Bruni-3
What is the current way to add shortcuts to the a TreeModel?
I am a bit lost, since I thought I just do something like this:

tree
        ^ tree ifNil: [
                tree := self instantiate: TreeModel.
                tree whenBuiltDo: [ self initializeShortcuts ]].

initializeShortcuts
        self shortCuts keysAndValuesDo: [ :key :value |
                self tree bindKeyCombination: key toAction: value ]

signature.asc (457 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Spec Tree Shortcuts

Benjamin Van Ryseghem (Pharo)
it does not work ?

Ben

On Oct 15, 2013, at 6:15 PM, Camillo Bruni <[hidden email]> wrote:

What is the current way to add shortcuts to the a TreeModel?
I am a bit lost, since I thought I just do something like this:

tree
^ tree ifNil: [
tree := self instantiate: TreeModel.
tree whenBuiltDo: [ self initializeShortcuts ]].

initializeShortcuts
self shortCuts keysAndValuesDo: [ :key :value |
self tree bindKeyCombination: key toAction: value ]

Reply | Threaded
Open this post in threaded view
|

Re: Spec Tree Shortcuts

Camillo Bruni-3
hmmm I think I confused myself :D, most probably I did not register
the commands on the outer widget, so the shortcuts do not work when
you don't have the focus on the tree :P


On 2013-10-15, at 18:50, Benjamin <[hidden email]> wrote:

> it does not work ?
>
> Ben
>
> On Oct 15, 2013, at 6:15 PM, Camillo Bruni <[hidden email]> wrote:
>
>> What is the current way to add shortcuts to the a TreeModel?
>> I am a bit lost, since I thought I just do something like this:
>>
>> tree
>> ^ tree ifNil: [
>> tree := self instantiate: TreeModel.
>> tree whenBuiltDo: [ self initializeShortcuts ]].
>>
>> initializeShortcuts
>> self shortCuts keysAndValuesDo: [ :key :value |
>> self tree bindKeyCombination: key toAction: value ]
>


signature.asc (457 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Spec Tree Shortcuts

Benjamin Van Ryseghem (Pharo)
:)

Ben

On Oct 15, 2013, at 7:31 PM, Camillo Bruni <[hidden email]> wrote:

hmmm I think I confused myself :D, most probably I did not register
the commands on the outer widget, so the shortcuts do not work when
you don't have the focus on the tree :P


On 2013-10-15, at 18:50, Benjamin <[hidden email]> wrote:
it does not work ?

Ben

On Oct 15, 2013, at 6:15 PM, Camillo Bruni <[hidden email]> wrote:

What is the current way to add shortcuts to the a TreeModel?
I am a bit lost, since I thought I just do something like this:

tree
^ tree ifNil: [
tree := self instantiate: TreeModel.
tree whenBuiltDo: [ self initializeShortcuts ]].

initializeShortcuts
self shortCuts keysAndValuesDo: [ :key :value |
self tree bindKeyCombination: key toAction: value ]