Roassal TRMouseClick on RTEdge bug

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

Roassal TRMouseClick on RTEdge bug

Peter Uhnak
Hi

When I attach TRMouseClick event on an edge it gets fired but the event element is nil so I have no reference to the original object. Since RTEdge is subclass of RTAnnouncableObject I would expect it to work correctly.

-------------
view := RTView new.

el1 := RTEllipse new size: 30; elementOn: 'a'.
el2 := RTEllipse new size: 30; elementOn: 'b'.

el1 translateTo: -50 @ 0.
el2 translateTo: 50 @ 0.

line := RTArrowwedLine edgeFrom: el1 to: el2.

el1 when: TRMouseClick do: [ :event | event element inspect ]. "returns el1"
line when: TRMouseClick do: [ :event | event element inspect ]. "returns nil"

view add: el1; add:el2; add: line.

view open.
------------------

Thanks,
Peter


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal TRMouseClick on RTEdge bug

Tudor Girba-2
Hi Peter,

Indeed, this was a bug. I fixed it in the latest version of Roassal2. Simply update the package to Roassal2-TudorGirba.512 and you should get your snippet running properly.

Cheers,
Doru



On Sat, Oct 4, 2014 at 1:50 PM, Peter Uhnák <[hidden email]> wrote:
Hi

When I attach TRMouseClick event on an edge it gets fired but the event element is nil so I have no reference to the original object. Since RTEdge is subclass of RTAnnouncableObject I would expect it to work correctly.

-------------
view := RTView new.

el1 := RTEllipse new size: 30; elementOn: 'a'.
el2 := RTEllipse new size: 30; elementOn: 'b'.

el1 translateTo: -50 @ 0.
el2 translateTo: 50 @ 0.

line := RTArrowwedLine edgeFrom: el1 to: el2.

el1 when: TRMouseClick do: [ :event | event element inspect ]. "returns el1"
line when: TRMouseClick do: [ :event | event element inspect ]. "returns nil"

view add: el1; add:el2; add: line.

view open.
------------------

Thanks,
Peter


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal TRMouseClick on RTEdge bug

Peter Uhnak
Thanks!

On Sun, Oct 5, 2014 at 3:59 PM, Tudor Girba <[hidden email]> wrote:
Hi Peter,

Indeed, this was a bug. I fixed it in the latest version of Roassal2. Simply update the package to Roassal2-TudorGirba.512 and you should get your snippet running properly.

Cheers,
Doru



On Sat, Oct 4, 2014 at 1:50 PM, Peter Uhnák <[hidden email]> wrote:
Hi

When I attach TRMouseClick event on an edge it gets fired but the event element is nil so I have no reference to the original object. Since RTEdge is subclass of RTAnnouncableObject I would expect it to work correctly.

-------------
view := RTView new.

el1 := RTEllipse new size: 30; elementOn: 'a'.
el2 := RTEllipse new size: 30; elementOn: 'b'.

el1 translateTo: -50 @ 0.
el2 translateTo: 50 @ 0.

line := RTArrowwedLine edgeFrom: el1 to: el2.

el1 when: TRMouseClick do: [ :event | event element inspect ]. "returns el1"
line when: TRMouseClick do: [ :event | event element inspect ]. "returns nil"

view add: el1; add:el2; add: line.

view open.
------------------

Thanks,
Peter


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev