Hi,
I'm afraid that you are on the wrong track. See my comments below.
[EMAIL PROTECTED] wrote:
> XController xController = xModel.getCurrentController();
> XFrame xFrame = xController.getFrame();
> xFrame.addEventListener(new com.sun.star.document.XEventListener() {
This registers your code for events that the frame can fire, but it
doesn't fire any events (except that is calls the "disposing" method of
all registered listeners in case it is closed and disposed).
>
> Sorry for the long post.....
> As you can see i have attached in the xFrame.addEventListener but it is
> never fired...
> I have also tried to insert it to the xModel even the xController...
> But no lack...
The Controller also doesn't fire any events (except the mentioned
"disposing" call), the Model will fire events that happen in the
document, e.g. when it is closed, if the "modified" flag changes etc.,
but nothing related to GUI elements.
> Maybe there is something i haven't undestood well
If you want to bind your code to menu entries you should first get
familiar with our Dispatch Framework that is documented in our DevGuide.
In short words, each menu entries has an assigned command that gets
"executed" when the menu entry is selected. There are two ways to get
code called when a particular command is executed: Dispatch Interceptors
and ProtocolHandlers. While the latter seems to be more complicated at a
first glance it isn't (IMHO) and it's the way I recommend. As I wrote,
please read about it in our DevGuide.
Regards,
Mathias
--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]