[Date Index] [Thread Index] [Author Index]
Re: Robust identifier for notebook objects?
One approach to this may be to just save the data inside of the palette itself. I gather that the logging notebook is not the key thing you are interested in, but rather just the data. So one approach would be to place the data into the TaggingRules of the palette. Whenever data is placed there, you would also do a Save on the palette so that the data will persist. Som approaches to placing data into Taggin rules are in the JoyOfTagging notebook on this page: http://scientificarts.com/worklife/conference2008.html Hope this helps, David On Jan 28, 6:35 am, Szabolcs <szhor... at gmail.com> wrote: > Dear MathGroup members, > > I need to create a palette that will have an associated notebook (for logging some information). > > The palette needs to feel like it is part of the GUI/Front End: it must keep working uninterrupted even if the kernel is restarted (meaning I can't store permanent state in the kernel) > > Question: How can I verify whether the logging notebook is already open in the front end, and retrieve a handle to it? Is this best done by setting a special name to the logging notebook, and searching for a notebook with this name? > > A bit more practical example: > > How can I create a palette button that: > > 1. if the logging notebook does not exist yet, it creates it > 2. if it does exist, it toggles its visibility > 3. keeps working across kernel restarts > 4. keeps working even if we close and open the palette (the palette will be installed to the Palettes menu, so it can be easily closed and reopened) > > The logging notebook is auto-generated, and it will never be saved to disk. (It does not need to persist across front end restarts.) > > Notes: > > * Point (4) above rules out using DynamicModule variables, even though they are owned by the front end. > > * It is also acceptable to persist not the logging notebook itself, but the data that it contains. I'm not sure how to make this persist through both kernel restarts and palette open/close though, so just toggling notebook visibility is easier. > > * Is there any way to store information for the current front end session only (maybe through $FrontEndSession)? > > Thank you for any replies in advance, > Szabolcs > > -- > New Mathematica site launched!http://mathematica.stackexchange.com/