Sign in Join

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

Mailing lists / lazarus / 2003-03

Crash after form show...

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Tony Maro

I just released another increment of CheckBook Tracker, but low and behold, it's not working unless you were already a current user.

It has something to do with the controls that I create and hide on the form unless you have a data file open. Unfortunately I can't find the crash exactly because it happens AFTER all of my code has executed. After the OnShow event of the main form is processed, it bombs with ERROR in LCL: Cannot focus a disabled or invisible window. I've checked my code for any "setfocus" statements and none of them are being used at the crash. You get a flicker of the window on the screen and then... poof.

Attached is the output along with my writeln debugs so I know what's happening... you can see the main form OnShow event from start to finish, with all subroutines it calls. As near as I can figure NONE of my code is executing when the crash happens. I've also enabled the VerboseFocus option in case that helps.

From the looks of it, the crash happens when the LCL tries to focus the

already displayed form...

Tony Maro http://tony.maro.net/ Check out my software "CheckBook Tracker" A GPL (free) replacement for Microsoft Money! -------------- next part -------------- A non-text attachment was scrubbed... Name: gz00015.gz Type: application/octet-stream Size: 687 bytes Desc: "out.txt.gz" Url : http://localhost/pipermail/lazarus/attachments/20030318/0f2ceccd/gz00015.obj

Reply by email

Tony Maro
to Tony Maro

Quite a bit actually. You can download the project sources from: http://tony.maro.net/mod.php?mod=downloads&op=showcat&id=1&level=1

I've pinned it down to a GTK focus problem related to the notebook control. It seems to be related to the focusing problem I reported on Monday with controls that are on the notebook control. It's as if the GTK hooks are not able to figure out what control has focus when the control is located on a tabpage.

If you look at the GTK output from the "calling .SetFocus" mail I sent Monday, you'll see that Lazarus gets confused about what control has focus and decides that a control is focused when GTK thinks that NIL is focused (or something like that.)

If I comment out the hiding of the notebook control which happens during the onshow event, the crash goes away. My current workaround is to make the notebook control one pixel tall instead of hiding it.

Thanks,
Tony

Solerman Kaplon wrote 5 lines
Hi Tony, what do you have on your onshow? paste the source, if possible... Connor

Reply by email

Solerman Kaplon
to Tony Maro: I just released another increment of CheckBook Tracker, but low and behold, it's not…

Hi Tony,

what do you have on your onshow? paste the source, if possible...

Connor

Tony Maro wrote 18 lines
More info that is key (and probably related to the focus problem I reported yesterday...) It only happens if I hide the tab page control in the onshow event. If I leave that control visible, it works fine. On Tue, 2003-03-18 at 17:56, Tony Maro wrote: >I just released another increment of CheckBook Tracker, but low and >behold, it's not working unless you were already a current user. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Mattias Gaertner
to Tony Maro: I just released another increment of CheckBook Tracker, but low and behold, it's not…
Show quoted text 17 lines
Quite a bit actually. You can download the project sources from: http://tony.maro.net/mod.php?mod=downloads&op=showcat&id=1&level=1 I've pinned it down to a GTK focus problem related to the notebook control. It seems to be related to the focusing problem I reported on Monday with controls that are on the notebook control. It's as if the GTK hooks are not able to figure out what control has focus when the control is located on a tabpage. If you look at the GTK output from the "calling .SetFocus" mail I sent Monday, you'll see that Lazarus gets confused about what control has focus and decides that a control is focused when GTK thinks that NIL is focused (or something like that.) If I comment out the hiding of the notebook control which happens during the onshow event, the crash goes away. My current workaround is to make the notebook control one pixel tall instead of hiding it.

If this bug is still there: Plz compile with VerboseFocus and start your program with gdb and send the backtrace.

Mattias

Reply by email