[Manifold-l] Click events and Themes
adamw at manifold.net
adamw at manifold.net
Tue Oct 24 07:46:44 CDT 2006
A follow up on a two-week old message...
> I'm catching click events via a OnClick script. As an example,
> I'm trying this:
>
> Context.Application.MessageBox(
> Context.EventArgs.Object.OwnerComponent.Name,
> "Component name")
>
> and it works perfectly with drawings... but not with Themes.
I think you are missing a type cast:
using Manifold.Interop.Scripts;
using M = Manifold.Interop;
class Script {
static void Main() {
if (Context.EventArgs.HasObject()) {
M.Component component = (M.Component)
Context.EventArgs.Object.OwnerComponent;
Context.Application.MessageBox(component.Name, "Script");
}
}
}
This should always output the name of the drawing containing the clicked object, even if you will actually use a theme component.
--
Adam Wachowski
Manifold Development Team
More information about the Manifold-l
mailing list