On Tue, 16 Mar 1999, Asger K. Alstrup Nielsen wrote:
> Allan wrote:
> > Every inset with an associated popup needs to know which buffer it belongs
> > to so the popup can talk to it (eg. get/set data). I haven't given much
> > thought to removing this requirement but I am certainly open to
> > suggestions.
I must have only been thinking about 1.0.x when I wrote this because the
solution I use at present in 1.1.x is to just pass the Inset* to the
associated popup. Just in case the user deletes the inset while its popup
is open there is a signal activated by the Insets destructor that tells
the popup the Inset is no longer valid and the popup closes.
> Precisely, the Inset's need to know the BufferView where the click
> comes from!
>
> Therefor, when we invoke the "Click" method of an inset, we will pass
> along the correspoding BufferView. Then the inset will be able to get
> to the hosting Buffer, because a BufferView contains a Buffer.
This scheme may be useful for some Insets (I'm not sure which) but most
Insets won't need this. Any of the inset-popups that need to call Buffer
or BufferView routines do so via calls to Communicator# which operates on
the current bufferview of its associated LyXView (remember each LyXView
has its own Communicator). This is safe because if a user has an
inset-popup open and changes buffers (or bufferviews within a LyXView)
then all the popups are updated, deactivated or hidden. So it's
impossible to get info meant for one buffer put into the wrong buffer.
Allan. (ARRae)
# Liason seems like a better name than Communicator.