← Back to team overview

kicad-developers team mailing list archive

Re: Ugly hack in LIB_VIEW_FRAME

 

On Mon, Jul 17, 2017 at 04:29:44PM -0400, Wayne Stambaugh wrote:
> On 7/17/2017 4:15 PM, Chris Pavlina wrote:
> > The following is in LIB_VIEW_FRAME (viewlib_frame.h specifically):
> > 
> >     // TODO(hzeller): looks like these members were chosen to be static to survive different
> >     // instances of this browser and communicate it to the next instance. This looks like an
> >     // ugly hack, and should be solved differently.
> >     static wxString m_libraryName;
> > 
> >     static wxString m_entryName;
> > 
> > Is this a feature anyone needs? I can't see why the browser has to
> > remember its list selection across instances. Will anyone miss this if I
> > just make them non-static?
> > 
> 
> Given that the kiface does not actually destroy the library viewer top
> level window but rather hides it,

I am not so sure about this. If I set a breakpoint on the constructor,
it fires every time I call up the dialog. It looks like there may be an
unnecessary call to Destroy(), I'll look into that.

> defining these variables normally
> shouldn't make any difference in the behavior.  I believe this behavior
> goes back to the pre-kiface days when closing the library viewer would
> actually destroyed the viewer top level window.  I like the fact that
> the viewer comes back to the same point as I left it.  One thing you
> might want to do if you change this is confirm that the behavior of the
> viewer in the stand alone mode is the same as the single app mode.  It
> should be but there are some subtle differences when running apps in the
> stand alone mode versus the single app mode.
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References