Hi Laurent,

Alle 08:37, domenica 14 maggio 2006, Laurent Godard ha scritto:
> Hi Mathias
>
> Thanks for your response
>
> > Perhaps instead of macro event bindings we could use listeners as Basic
> > is able to implement them? But I'm not sure wether listeners implemented
> > in Basic will "survive" the termination of the macro that registers
> > them. But you or Paolo as Basic experts know, I assume. ;-)
>
> sounds interresting
> listeners can survive using a global variable
> but, the remaining problem is how to start the listeners

Just a small addition:
Of course, holding a reference of the listener into a global variable is a 
good thing, (especially when you need to de-register it at latter time), 
anyway, the listener survives even if you don't store it in a global var:

AFAIK a registered listener is not disposed by the Basic engine while the 
broadcaster still holds a reference to it:
f.e. with the following code you will be bothered by the msgbox whenever you 
change selection, and to kill the listener you must close the document:

------------------
Sub testListener()
oListener = createUnoListener("Doc_", _
"com.sun.star.view.XSelectionChangeListener")
ThisComponent.CurrentController.addSelectionChangeListener(oListener)
End Sub

Sub Doc_selectionChanged(oEvent)
msgbox "ciao"
End Sub

Sub Document_disposing(oEvent)
'nothing to do
End Sub
------------------


ciao
Paolo

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  • Re: [... Paolo Mantovani
    • ... Mathias Bauer
      • ... Laurent Godard
        • ... Mathias Bauer
    • ... Carsten Driesner - Sun Germany - ham02 - Hamburg - Software Engineer
    • ... Laurent Godard
      • ... Mathias Bauer
    • ... Carsten Driesner - Sun Germany - ham02 - Hamburg - Software Engineer
      • ... Laurent Godard
        • ... Mathias Bauer
    • ... Carsten Driesner - Sun Germany - ham02 - Hamburg - Software Engineer

Reply via email to