Recent

Author Topic: GTK2 / Win32 Inconsistency or Bug  (Read 1434 times)

daz

  • Full Member
  • ***
  • Posts: 111
    • http://matt-shaffer.com
GTK2 / Win32 Inconsistency or Bug
« on: December 29, 2018, 10:46:30 pm »
 The setup:
Place a TToggleBox and TRichMemo on a form

In the ToggleBox's change event, put:
Code: Pascal  [Select]
  1. procedure TForm1.ToggleBox1Change(Sender: TObject);
  2. var
  3.   fn: TFontParams;
  4. begin
  5.   if ToggleBox1.Checked then
  6.   begin
  7.     RichMemo1.GetTextAttributes(RichMemo1.SelStart, fn);
  8.     fn.Style := fn.Style+[fsBold];
  9.     RichMemo1.SetTextAttributes(RichMemo1.SelStart, RichMemo1.SelLength, fn);
  10.   end;
  11. end;

Run the application. Move the cursor to be after the text "RichMemo1". Press the ToggleBox to trigger bold text formatting. Type text.

EXPECTED: additional text typed after "RichMemo1" is bold. This happens correctly on Windows. This does not work in Linux/GTK2.

(See attachment for pic if there's confusion)

Using latest code from SVN on both Windows and Linux. (Also: Lazarus 1.8.4, not that I think that matters)