On Mon, 30 Apr 2007 12:25:59 +0200
Giuliano Colla <[EMAIL PROTECTED]> wrote:

> Graeme Geldenhuys ha scritto:
> > On 4/29/07, Vincent Snijders <[EMAIL PROTECTED]> wrote:
> >>
> >> Applied in r11031
> >>
> > 
> > Thanks Vincent.
> > 
> >> Another (or the same) issue. If I configure the toolbar, the newly
> >> configured toolbar appended to the current toolbar. So if I
> >> reconfigure 3 times in a lazarus sessions, I got 4 configure
> >> buttons. After restart the toolbar is correct.
> > 
> > Ah, I take if you are running Windows then...  This is a bug I found
> > while testing under Windows.  No such issues under GTK1.  I'll
> > double check if I reported this issue in Mantis.
> > Under Win32, you cannot hide a Toolbar Button for some reason. It
> > always stays visible.  If you can figure out a work-around or a fix,
> > please don't hesitate to submit a patch. :-)
> > 
> > My first attempt to get around that bug was to free the existing
> > buttons when the users clicks OK in the Toolbar Config screen, and
> > then rebuild it from scratch. That didn't go down well either and
> > caused Lazarus to crash.  Still can't figure out how to free off
> > existing buttons without a crash.
> 
> I had a similar problem in an app, and I found (the hard
> way :-) )that using Application.ReleaseComponent(myComponent), in
> place of myComponent.free, worked fine. It seems that Application
> "remembers" for some time the "phantom" component, trying to get its
> bounds when painting the form, or checking for its PopUp property,
> and this gives rise to an access violation. ReleaseComponent
> synchronizes the object deletion to when housekeeping has been
> finished.

It is pretty normal, that you can not free a component, while in an
event for this control. That's why there is ReleaseComponent, which
frees the component after the events have been processed.
Otherwise you found a bug. Can you create an example?

 
> So a sequence sort of:
> 
> myComponent.Hide; // to make sure it's erased when its bounds are
> still available
> Application.ReleaseComponent(myComponent);
> myComponent := Nil; // if you need it
> 
> For me works. Maybe this applies to your case too.
> 
> However this is a *BIG* Delphi incompatibility.

Can you provide an example?

Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to