I have a ListComposableModel rendered with spec that I want to do something if an element is double clicked. How do I register the event handler? I know about on:send:to but what Announcement do I use? In my testing with just a symbol #doubleClick it doesn't work (and probably isn't supposed to). thanks, Lo
I have a ListComposableModel rendered with spec that I want to do something if an element is double clicked.
for double clicked I do not know. Did you check the when* API of ListComposableModel?
How do I register the event handler? I know about on:send:to
when:send:to:
but what Announcement do I use? In my testing with just a symbol #doubleClick it doesn't work (and probably isn't supposed to).
In which Pharo version are you?
thanks, Lo
Did you check the when* API of ListComposableModel?
Yes, the closest thing might be whenSelectionChanged but nothing regarding click events as I see it.
How do I register the event handler? I know about on:send:to
when:send:to:
In my ComposableModel the ListComposable model is 'attributes' so I did in initializeWidgets: attributes when: #doubleClick send: #onDoubleClick to: self. where the method logs to the transcript. But nothing shows up on a double click. I suspect that spec has to setup the morphs it creates for handling (double)clicks and maybe it doesn't?
In which Pharo version are you? Latest 2.0
greetings, Lo
On Nov 23, 2013, at 6:55 PM, Lorenz Köhl <lorenz@quub.de> wrote:
Did you check the when* API of ListComposableModel?
Yes, the closest thing might be whenSelectionChanged but nothing regarding click events as I see it.
How do I register the event handler? I know about on:send:to
when:send:to:
In my ComposableModel the ListComposable model is 'attributes' so I did in initializeWidgets:
attributes when: #doubleClick send: #onDoubleClick to: self.
where the method logs to the transcript. But nothing shows up on a double click.
I suspect that spec has to setup the morphs it creates for handling (double)clicks and maybe it doesn't?
In which Pharo version are you? Latest 2.0
I strongly suggest to use 30 because spec changed a lot.
greetings, Lo
I strongly suggest to use 30 because spec changed a lot.
Doesn't seem to work either (on yesterdays 30): | m | m := ListModel new items: #(a b c). m when: #doubleClick send: #traceCr to: Transcript. m on: #doubleClick send: #traceCr to: Transcript. "need doubleclick announcement?" m openWithSpec Maybe there's some spec mechanism for adding the EventHandler stuff to the morphs it creates? greetings, Lo
m := NewListModel new m doubleClickAction: [ self halt ] m openWithSpec This should work Ben On 23 Nov 2013, at 19:23, Lorenz Köhl <lorenz@quub.de> wrote:
I strongly suggest to use 30 because spec changed a lot.
Doesn't seem to work either (on yesterdays 30):
| m | m := ListModel new items: #(a b c). m when: #doubleClick send: #traceCr to: Transcript. m on: #doubleClick send: #traceCr to: Transcript. "need doubleclick announcement?" m openWithSpec
Maybe there's some spec mechanism for adding the EventHandler stuff to the morphs it creates?
greetings, Lo
On Nov 23, 2013, at 7:37 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
m := NewListModel new m doubleClickAction: [ self halt ]
m openWithSpec
your code and the following (double clicking the list items) doesn't work for me in Pharo3.0 Latest update: #30591 m := NewListModel new items: #(a b c). m doubleClickAction: [ Transcript traceCr: 'foo' ]. m openWithSpec
I will have a look tomorrow :) If you are in a hurry, I know such a behaviour is present in EyeInspector Ben On 24 Nov 2013, at 00:07, Lorenz Köhl <lorenz@quub.de> wrote:
On Nov 23, 2013, at 7:37 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
m := NewListModel new m doubleClickAction: [ self halt ]
m openWithSpec
your code and the following (double clicking the list items) doesn't work for me in Pharo3.0 Latest update: #30591
m := NewListModel new items: #(a b c). m doubleClickAction: [ Transcript traceCr: 'foo' ]. m openWithSpec
participants (3)
-
Benjamin -
Lorenz Köhl -
Stéphane Ducasse