Le 16 oct. 06, à 13:38, Carsten Driesner a écrit :

I checked my code and it works without any problem. OpenOffice.org internally uses the same mechanism, if you customize the menubar with Tools-Customize. Please check if you use the correct frame to destroy/create the menubar.


Hi Carsten,
I have checked more thoroughly, and it seems that your sample code (with destroyElement/createElement) does nothing if called too early during the startup phase (even though the document and its frame is visually complete). I have tried to call it later, and it works. Thank you again for this.

Although your solution may work in most cases, a crash would leave persistent changes. You should consider to use transient changes on the user interface. The Basic code at the end of this message uses the transient user interface feature to change the menu bar for a frame. No other frame can see the changes and even a crash won't change any file.

---------------------------------------------------------
Sample code to make transient changes on a frame menu bar
(...)

I agree perfectly that the persistant change made to the menu bar by my add-on isn't satisfying.

I will try your alternative solution (transient modifications) as soon as I can.

However, I fear a bit about using so many "unpublished" features, mostly because we will sell our add-on to many customers who will upgrade OO regularly but not necessarily our add-on. Could you please tell me your feedback about the stability of this "underdocumented" API in the future ? (I mean, accessing the layout manager, retrieving the menu bar by its element name, setting the 'Persistent' property, using the element settings, browsing through the menu tree, etc.)
Can I be confident about its lifetime ?

Thank you anyway for your complete answer.

Julien

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

Reply via email to