On Fri, Aug 24, 2012 at 10:22 PM, brian <[email protected]> wrote:
> Hi all, > > I'm trying to port a Delphi program to Lazarus, although I'm redoing the > interface from scratch. > > Without getting into to much detail about what the program does, it needs > an array of 72 buttons on the main screen, these buttons have their > captions changed and are variously enabled and disabled as the program > executes. > > Because of the underlying logic, it's easiest to manipulate these buttons > as an array of pointers to the buttons (in fact two arrays, but that's not > really relevant). > > So, I have > > Type > TBtnPtr = ^TButton; > TBtnArray = Array [1..36] of TBtnPtr; > > Var > Buttons1, Buttons2 : TBtnArray; > > > Then in a procedure called from the Form's OnCreate, I set the arrays up :- > > Buttons[1]^ := FirstButton; > Buttons[2]^ := SecondButton; > > etc, etc. > > Everything compiles OK, but at runtime, the moment the program reaches > that first assignment statement running interactively under GDB, I get an > error "Exception class External : SIGSEGV" > > This is using SVN 38353M (downloaded and built this morning) with FPC > 2.6.0 on an AMD Phenom X4 box running Debian SID 64-bit, and generating a > 64 bit executable. > > I'm lost. This same code worked under Delphi 7. Can anyone give me a hint > as to what I'm doing wrong? I wanted to create the buttons as design time > so that I can set the initial layout, but if I need to create them > dynamically I can do that. > > It will not answer your question (there are few details that are missing there), but I'ved wrote a component for Lazarus few years ago that provide a grid of buttons: https://github.com/ik5/linesip-components It might be useful for your to try and use it instead, or at least learn from it. > > Thanks > > Brian > Ido > > -- > ______________________________**_________________ > Lazarus mailing list > [email protected].**freepascal.org<[email protected]> > http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus> >
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
