[SOLVED] TToggleBox: font is returning to default lazarus / 31-LCL ---------------------------------------------------------------------- SibBear · 2013-07-30 20:27 I modified the font of the toggle button's caption: increased the size, changed color and style. But after clicking the font is changing back to default. I also tried to modify it in the clicking event procedure: Code: [Select]procedure TForm1.ToggleBox1Change(Sender: TObject); begin     if ToggleBox1.State=cbChecked then ToggleBox1.Caption:='STOP'     else ToggleBox1.Caption:='START';     ToggleBox1.Font.Height:=20;     ToggleBox1.Font.Color:=clRed;     ToggleBox1.Font.Style:=[fsBold]; end; But it had no effect. How can I do it? Thanks, Michael. ---------------------------------------------------------------------- Blaazen · 2013-07-30 22:12 I just tested on Linux+Qt and works well. Sometimes people report here that buttons on Windows cannot change font color, it depends on Windows themes. TToggleBox is a native widget just like TButton or TBitBtn so it probably has the same issue. ---------------------------------------------------------------------- SibBear · 2013-07-30 22:16 I use Linux. ---------------------------------------------------------------------- Blaazen · 2013-07-30 22:46 OK, I just tested with GTK2 and works well too (test: font parameters -color, size and style - are changed in onclick event). EDIT: I also tried to change font params. in OI but they never fall back to default after clicking. Try to make demo project. BTW, your linux is Qt or GTK2 ? ---------------------------------------------------------------------- SibBear · 2013-07-30 22:57 I launched program from console, and there are many errors: IA__gdk_draw_rectangle: assertion `GDK_IS_DRAWABLE (drawable)' failed Maybe it's cause of the problem? I use Debian Wheezy with KDE. ---------------------------------------------------------------------- Blaazen · 2013-07-30 23:38 And Lazarus itself is GTK2 or Qt? Can you copy info from "about" box? ---------------------------------------------------------------------- SibBear · 2013-07-31 11:31 Sorry, where I live, there was time to sleep Lazarus 1.0.8, FPC 2.6.2, x86_64-linux-gtk 2 ---------------------------------------------------------------------- Blaazen · 2013-07-31 13:01 So you run GTK2 Lazarus on KDE4 distro? You can try Lazarus + Qt, it works well and it is more native. Anyway, I cannot reproduce this bug and I don't get any error messages in console. ---------------------------------------------------------------------- SibBear · 2013-07-31 13:19 Where can I get the Qt version? On SF there is only GTK version. ---------------------------------------------------------------------- taazz · 2013-07-31 13:35 QuoteTo compile the IDE for qt, first create a backup of the lazarus executable for the case something goes wrong. Then open Tools / Configure Build Lazarus and set LCL Widget Type to qt. Then click Build. After a restart you will get the qt IDE. All projects are now compiled by default with qt. Source http://wiki.freepascal.org/Qt_Interface ---------------------------------------------------------------------- SibBear · 2013-07-31 13:37 Thanks to all. ---------------------------------------------------------------------- SibBear · 2013-07-31 14:00 I've compiled libQt4Pas, recompiled Lazarus, and it works fine now! Thanks!