Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2002-10

One more cool little bug

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner
to Tony Maro: I've got the neatest thing that happens. When I try to create all my controls in the…
Show quoted text 9 lines
I've got the neatest thing that happens. When I try to create all my controls in the OnCreate event of my form, half of them won't display, half display wrong, and the runtime generated menus are completely scrambled with huge spaces between entries and the order all wrong. The same code placed in the OnShow event of the same form works just fine. Anyone else ever see this?

Plz don't send me an example or else the cool little bug will die.

Mattias

Reply by email

Mattias Gaertner
to Tony Maro: I've got the neatest thing that happens. When I try to create all my controls in the…
Show quoted text 14 lines
On Tue, 2002-10-08 at 12:31, Mattias Gaertner wrote: > > When I try to create all my controls in the OnCreate event of my form, > > half of them won't display, half display wrong, and the runtime > > generated menus are completely scrambled with huge spaces between > > entries and the order all wrong. The same code placed in the OnShow > > event of the same form works just fine. > > Plz don't send me an example or else the cool little bug will die. > Hadn't planned on it <<BG>>. Seriously though, if you WANT the source I've posted it.

Oh no. I warned you.
Rest in peace little bug. Tony will never forget you ... or at least the cvs ...

I have also repaired Ellipse.

Mattias

Show quoted text 46 lines
I'm not sure if it happens every time or not but I've definitely seen it. That's why I was kind of wondering if anybody else had seen that happen... It didn't do this on mine until I was creating a lot of components at runtime. http://members.telocity.com/~tonymaro/cbtracker.bad.tar.gz Look in the oncreate and onshow events of the FrmMain (unitmain.pas). I commented out code from it's usual location in the onshow event and pasted it into the end of the oncreate event. Even though it probably SHOULD work the net result is quite complex... If you compile and run this as is, it will crash with tons of errors about invalid parents and the like. I just realized that. If however you put the code back to normal, run it once, create a new checkbook file and exit (so it will auto-load it next time) THEN you run the above posted code, it will run (throwing tons of GTK warnings) and scrambles things. Simply moving the same code from OnCreate to OnShow fixes the issue. OR... After painful testing I found that changing the order and creating the menus BEFORE the LblAboutTransactions component while in the OnCreate event also seems to fix it. If I create the menus AFTER I create that label, the menus are trashed and throw GTK errors everywhere, UNLESS it's done in the OnShow event. Go figure. Like I said, it's pretty complex and I'm not positive there's not some aspect of my code interfering, but I don't think so. I've seen almost identical problems with placing all the controls on the form at design time - that's why I switched to creating at runtime. -Tony _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Tony Maro
to Tony Maro: I've got the neatest thing that happens. When I try to create all my controls in the…
Mattias Gaertner wrote 8 lines
> When I try to create all my controls in the OnCreate event of my form, > half of them won't display, half display wrong, and the runtime > generated menus are completely scrambled with huge spaces between > entries and the order all wrong. The same code placed in the OnShow > event of the same form works just fine. Plz don't send me an example or else the cool little bug will die.

Hadn't planned on it <<BG>>.

Seriously though, if you WANT the source I've posted it. I'm not sure if it happens every time or not but I've definitely seen it. That's why I was kind of wondering if anybody else had seen that happen... It didn't do this on mine until I was creating a lot of components at runtime.

http://members.telocity.com/~tonymaro/cbtracker.bad.tar.gz

Look in the oncreate and onshow events of the FrmMain (unitmain.pas). I commented out code from it's usual location in the onshow event and pasted it into the end of the oncreate event. Even though it probably SHOULD work the net result is quite complex...

If you compile and run this as is, it will crash with tons of errors about invalid parents and the like. I just realized that.

If however you put the code back to normal, run it once, create a new checkbook file and exit (so it will auto-load it next time) THEN you run the above posted code, it will run (throwing tons of GTK warnings) and scrambles things.

Simply moving the same code from OnCreate to OnShow fixes the issue.

OR...

After painful testing I found that changing the order and creating the menus BEFORE the LblAboutTransactions component while in the OnCreate event also seems to fix it. If I create the menus AFTER I create that label, the menus are trashed and throw GTK errors everywhere, UNLESS it's done in the OnShow event.

Go figure.

Like I said, it's pretty complex and I'm not positive there's not some aspect of my code interfering, but I don't think so.

I've seen almost identical problems with placing all the controls on the form at design time - that's why I switched to

Reply by email

Shane Miller

" Plz don't send me an example or else the cool little bug will die."

Good one! :-)

Shane

Earlier message 28 lines
-----Original Message----- From: Mattias Gaertner Sent: Tuesday, October 08, 2002 12:32 PM To: Subject: Re: [lazarus] One more cool little bug On 08 Oct 2002 12:19:11 -0500 Tony Maro wrote: > I've got the neatest thing that happens. > > When I try to create all my controls in the OnCreate event of my form, > half of them won't display, half display wrong, and the runtime > generated menus are completely scrambled with huge spaces between > entries and the order all wrong. The same code placed in the OnShow > event of the same form works just fine. > > Anyone else ever see this? Plz don't send me an example or else the cool little bug will die. Mattias _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Tony Maro

I've got the neatest thing that happens.

When I try to create all my controls in the OnCreate event of my form, half of them won't display, half display wrong, and the runtime generated menus are completely scrambled with huge spaces between entries and the order all wrong. The same code placed in the OnShow event of the same form works just fine.

Anyone else ever see this?

Thanks, Tony

Reply by email