Vanishing label lazarus / 31-LCL ---------------------------------------------------------------------- timppl · 2014-01-17 07:19 Hi all There appears to be a bug in the attached project. There are 2 labels in a TGroupBox. Both labels are AutoSize = True; When the caption of Label3 is changed, the label disappears. However if the commented out code in the function Button1MouseUp is enabled then Label3 works correctly. The code works correctly with Lazarus 1.0.14 ( FPC 2.6.2 ) but does not work with  Lazarus 1.2RC2  ( FPC 2.6.2 ) or with Lazarus 1.3  ( FPC 2.7.1 ) It is possible that I have done something stupid, but if it is really a bug I will put it on Mantis Regards Tim ---------------------------------------------------------------------- howardpc · 2014-01-17 08:34 As far as I can see your code accomplishes exactly what you specify: when the button is clicked you set label3's caption to a new value which is correctly displayed, irrespective of Label1's caption value. I see no difference with different Lazarus versions. No bug at all (at least on Win32, the only platform I tested). ---------------------------------------------------------------------- wp · 2014-01-17 10:00 Maybe you are concerned about the labels vanishing while the mouse button is pressed. Use the OnClick event of the button to get an immediate response. ---------------------------------------------------------------------- timppl · 2014-01-20 07:08 Thanks for the replies What concerns me is that on linux/gtk2, this line Code: [Select]Label3.Caption:='RefreshedLabel'; does not work if it is the last item in the method. @WP If I use On click the problem is still there. The caption of label3 does not display.  If Label3 is set to Autosize:= False then Label3 works correctly. So to restate the steps to see the different behaviour of Label3 1)  Compile and run the project  2) Click the 'Change Text' button  -  Label3 caption does not display 3)  Set Autosize to False ( you may need to resize the label to display its initial caption correctly ) 4) Compile and run the project 5) Click the 'Change Text' button  -  Label3 caption shows correctly i.e 'Refreshed Label' An alternative way of showing the problem is to set the colour of Label3 without changing anything else in the project.  When the 'Change Text' button is clicked the label is no longer visible. @Howardpc  As you said, it works correctly on windows, the problem appears to be with gtk2 on linux, and only with versions of lazarus from 1.2RC2 onwards ie the code perform identically on windows and linux with Lazarus 1.0.14 ( fpc 2.6.2 )  but performs differently with lazarus 1.2RC ( fpc 2.6.2 ) and 1.3 ( fpc 2.7.1 ) Regards Tim ---------------------------------------------------------------------- Martin_fr · 2014-01-20 12:13 I can reproduce it on gtk2 indeed (only tested with current 1.3 / not tested 1.0.14) Please report, and mention it is a regression. I also noted, that the designer shows "shadows" of the selection indicators. (see image, only the ONE label is selected). Do you get those too? ---------------------------------------------------------------------- timppl · 2014-01-21 07:55 Thanks Martin_fr I have reported it on Mantis. I have just had a look and I dont seem to be able to get the shadowed selection indicators. Regards Tim