Author Topic: OnClick event stops working  (Read 644 times)


  • Full Member
  • ***
  • Posts: 224
Re: OnClick event stops working
« Reply #15 on: November 08, 2019, 12:25:53 pm »
Meanwhile, here is a thing.  I have found that renaming a 'dead' listbox revivifies it: the same old onclick event kicks back into life with no changes to the unit/frame other than those the IDE imposes when the name changes.  The compiler complains that 'the ancestor for [old name of control]' is missing.  I can overcome that by creating a new control with the old name (and no events).  The compiler is then content and the re-created control can just be ignored or hidden while the renamed control does the work. 

The risk here is that the revised listbox is being saved in the context of the form, not in the context of the frame. I'm pretty sure I've seen this sort of thing: when frames are good they are very very good, but when they are bad they are horrid :-)

Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.


  • Hero Member
  • *****
  • Posts: 6334
Re: OnClick event stops working
« Reply #16 on: November 08, 2019, 12:56:43 pm »
When ever I used frames I get a little upset when making changes to the frame itself it does not change in the forms that are using the frame
Changes made to a frame unit are updated in the form in which the frame is used only after closing and reloading that forrm. Yes, this is very annoying and confusing, and is one of the reasons why I almost always insert frames at runtime. The IDE uses a LOT of frames (see folder ide/frames), and they are always inserted at runtime.
« Last Edit: November 08, 2019, 12:59:06 pm by wp »
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10


  • Hero Member
  • *****
  • Posts: 2083
Re: OnClick event stops working
« Reply #17 on: November 08, 2019, 11:15:22 pm »
I suppose using dynamic frames could save some resources although I've never used them that way..

 I kind of think of them as my Library controls stash without making a control..

 I have very few frames. The ones I mostly use are for a menu entry that gets used in a lot of different ways but it keeps with the same format so the user does not get confused..
Number 1 at blue screen app creations!