On Mar 10, 2009, at 5:58 PM, Thomas Tempelmann wrote:
On Tue, Mar 10, 2009 at 22:53, William Yu <[email protected]>
wrote:
Sorry if it wasn't clear, but this allows you to override the
framework's
plugin event model, so instead of receiving events from the
framework when
something happens, you would handle this yourself in the plugin and
notify
the framework when an event (like a click) happens.
Meaning that if I registered some event with the Carbon event manger
(or CF... stuff?), I could have it passed on to the RB framework? I
guess a plugin might want to request a focus change, or a redraw. Will
that be possible? Or is it about other mechanisms?
I would like to have the ability to not subclass a REALwindow in a
plugin and being forced to use a REALeventInstance on a window event,
but rather would like to have the ability to grab a REALwindow and
install an RBFrameWork event handler on the window and that than the
framework is not complaining about that. It means that then the plugin
does not require the registration of a "WordGuiseWindow" and tell
users of the WordGuise Plugin to set the super their window to a
WordGuiseWindow. It also means that
""_InstallInstanceEventHandler(target As Object, eventName As
String, handler As Ptr)"
should be exposed to the plugin using the Entry point:
RuntimeInstallInstanceEventHandler
It would look like this in the plugin SDK:
void Runtime_InstallInstanceEventHandler(REALobject target, REALstring
eventName, REALproc handler)
{
static void (*_fp)(REALobject, REALstring, REALproc) = nil;
// if (!_fp)
// _fp = (void(*)(REALobject, REALstring,
REALproc))REALLoadGlobalMethod(nil,
"_InstallInstanceEventHandler(target As Object, eventName As String,
handler As Ptr)");
if (!_fp)
{
// MSG(DYNAMIC ACCESS FAILURE: Runtime_InstallInstanceEventHandler)
_fp = (void(*)(REALobject, REALstring,
REALproc))VHResolver("RuntimeInstallInstanceEventHandler");
}
if (_fp)
_fp(target, eventName, handler);
else
MSG(RESOLVER AND DYNAMIC ACCESS FAILURE:
Runtime_InstallInstanceEventHandler)
}
We use this and works like a charm when calling for example
REALnewInstance("Canvas") and then install event handlers on it. THis
canvas is part of the WordGuise control, and does something similar to
the hidden canvas of a ContainerControl.
Another feature we use is _AddControl, which allows us to get this
canvas on the window (and on the fly if necessary).
This would be good additions, and provides an example of what William
might want to implement...
Again: WordGuise, since its conception, uses a RectControl onto which
we place a canvas and two scrollbars, using the entry points for
_AddControl and _InstallInstanceEventHandler.
another addition to the SDK would be to allow creation of a window.
Amalgam plugin id doing that already but we would like to see to have
it casted to a REALwindow, so that Drawables (definition of our
windows) can become REALwindows. This would then allow the
instantiation of canvasses and such on these transparent drawables.
I hope that all of this conforms to the subject of this thread: Two
way event model, which could be better defined as a "two way model"
regards,
Alfred
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>