Hallo all,

I tried to implement a "com.sun.star.lang.XEventListener" on a code-created Dialog, the Listener is not working. I used the same "Listener" on loading a manuel created Dialog from a library, here the listener works a expected.

Please test my code if we have a iussue or a fault in my code ?

For the sub with manual loaded Dialog, you just need aan simple "Dialog1" in het "Standard" library The other sub is always working but the Lister will not work on closing the dialog

Thanks for any advice

Fernand


sub Load_dialog()
    DialogLibraries.LoadLibrary( "Standard" )
oDialog = createUnoDialog( DialogLibraries.GetByName( "Standard" ).GetByName( "Dialog1" ) ) oListener = CreateUnoListener("Listensub_", "com.sun.star.lang.XEventListener")
    oDialog.addEventListener(oListener)
    odialog.execute
    end sub


Sub Create_Dialog()
oDialogModel = createUnoService( "com.sun.star.awt.UnoControlDialogModel" )
   oDialogModel.PositionX = 50
   oDialogModel.PositionY = 50
   oDialogModel.Width = 200
   oDialogModel.Height = 200
   oDialogModel.Title = "Test"
   oDialog = createUnoService( "com.sun.star.awt.UnoControlDialog" )
   oDialog.setModel( oDialogModel )
oListener = CreateUnoListener("Listensub_", "com.sun.star.lang.XEventListener")
   oDialog.addEventListener(oListener)
   oDialog.setVisible( True )
   odialog.execute
end sub


Sub Listensub_disposing(oEvent)
msgbox("Dialog is Closing")
End Sub

Reply via email to