Sign in Join

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

Mailing lists / lazarus / 2011-11

Changing a TLabel.Caption

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Timothy Groves

I tried changing a TLabel.Caption property, and got a SIGSEGV. Here's the offending code:

if (cmbProfileMeasures.Text = 'Inches') then
       begin
       labPDFWidth.Caption := 'in X';
       labPDFHeight.Caption := 'in';
     end
     else
       if (cmbProfileMeasures.Text = 'Points') then
       begin
           labPDFWidth.Caption := 'pt X';
           labPDFHeight.Caption := 'pt X';
       end
         else
         begin
           labPDFWidth.Caption := 'cm X';
           labPDFHeight.Caption := 'cm X';
       end;

I am using Lazarus 0.9.30-2build1 on LUbuntu 11.10.

Reply by email

Juha Manninen
to Timothy Groves

2011/11/26 Timothy Groves

Show quoted text 20 lines
I tried changing a TLabel.Caption property, and got a SIGSEGV. Here's the offending code: if (cmbProfileMeasures.Text = 'Inches') then begin labPDFWidth.Caption := 'in X'; labPDFHeight.Caption := 'in'; end else if (cmbProfileMeasures.Text = 'Points') then begin labPDFWidth.Caption := 'pt X'; labPDFHeight.Caption := 'pt X'; end else begin labPDFWidth.Caption := 'cm X'; labPDFHeight.Caption := 'cm X'; end;

The controls (and form) are not created for some reason. The code itself looks OK.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111127/98629521/attachment.html>

Reply by email

Lukasz Sokol
to Juha Manninen
Juha Manninen wrote 28 lines
2011/11/26 Timothy Groves < <mailto:>> I tried changing a TLabel.Caption property, and got a SIGSEGV. Here's the offending code: if (cmbProfileMeasures.Text = 'Inches') then begin labPDFWidth.Caption := 'in X'; labPDFHeight.Caption := 'in'; end else if (cmbProfileMeasures.Text = 'Points') then begin labPDFWidth.Caption := 'pt X'; labPDFHeight.Caption := 'pt X'; end else begin labPDFWidth.Caption := 'cm X'; labPDFHeight.Caption := 'cm X'; end; The controls (and form) are not created for some reason. The code itself looks OK. Juha

Wild guess : OP is putting this code into FormCreate handler ?

L.

Reply by email

Juha Manninen
to Lukasz Sokol

2011/11/28 Lukasz Sokol

Wild guess : OP is putting this code into FormCreate handler ?

OP has not put that code anywhere automatically, it is created by hand. Besides the code would be ok in a FormCreate handler. Timothy, we can find the problem if you send a complete application demonstrating the problem.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111128/f1952726/attachment.html>

Reply by email