Changing Form.Caption lazarus / 31-LCL ---------------------------------------------------------------------- tintinux · 2012-01-23 17:16 Hi In a TForm object, I change the title by Form.Caption := 'something else' Most times, this changes nothing in display. In only one Form of my project (over 30) this works perfectly, the title is changed. I am unable to see any difference between the working form and all the others. I do have added Update or Invalidate, and Application.ProcessMessages, but this changes nothing at all. Any idea ? Thanks ! ---------------------------------------------------------------------- IPguy · 2012-01-23 21:07 Can you give a simple example of the code you are using to change the window that works and the code for one of the other's that does not work? What are you using to trigger the change to the form.caption on each of the windows / forms? ---------------------------------------------------------------------- tintinux · 2012-01-24 12:32 Hi The code to change the caption is the same, it is in a common unit, defining a TForm's descendant, used by all forms. When a key is pressed, it finds translations, and update the form's caption. All owned controls captions are correctly updated right after. To simplify, something like : Code: [Select]procedure TGForm.DoKeyDown(Sender : TObject; var Key: Word; Shift: TShiftState); begin   case Key of     VK_F4 : Self.Caption := 'some translation';     end ; end ; I have checked that showmessage(caption) display the right one. This only looks like display/refresh issue. The full pascal code is downloadable below. Common unit : http://gestinux.svn.sourceforge.net/viewvc/gestinux/trun k/util/gform.pas Calling form, not working : http://gestinux.svn.sourceforge.net/viewvc/gestinux/trunk/unitmenu.pas Calling form, working : http://gestinux.svn.sourceforge.net/viewvc/ges tinux/trunk/unitmoves.pas Thanks ! PS : I'm using Lazarus 0.9.30. It happens with Linux GTK2 and Windows. ---------------------------------------------------------------------- IPguy · 2012-01-26 01:59 Probably not the issue, but a good practice anyway (so I've been told a few times by other board members.) I noticed that you only have application.processmessages; in unitmoves.pas and not in unitmenu.pas.  I would suggest adding it after you write the caption text to the form and see if that does any good. ---------------------------------------------------------------------- IPguy · 2012-01-26 02:04 (Rereading your second post)  Are you saying that writing the caption to formX fails, but all other modifications for FormX work?  What happens if you change the order in which you make changes?  Do you get the same results? ---------------------------------------------------------------------- tintinux · 2012-01-26 12:11 Quote from: IPguy Are you saying that writing the caption to formX fails, but all other modifications for FormX work?  What happens if you change the order in which you make changes?  Do you get the same results? Yes, the issue is only for caption of most of the forms. Captions and Hints of components owned by the Form are 99% correctly updated. I must say that I have noticed less than 1% of components not changing caption,  but may be there are other explanations. I have not investigated. I have added Application.Process messages and tried to change the order. Even to remove processing of sub components. Same result ! Strange, isn't it ? Thanks for trying to help ! ---------------------------------------------------------------------- IPguy · 2012-01-26 13:04 How about the brute force method? Create an onActivate event for each of the forms containing a line to set Form.caption and each time you run through the translate function, call the onActivate event for the "Self" form? ---------------------------------------------------------------------- tintinux · 2012-01-27 09:36 I have just discovered that, when I update the caption, the new caption is (most time) not changed on the main window, but it is changed in the taskbar  !  What could do such a strange thing ? Sounds like a bug... Quote from: IPGuyCreate an onActivate event...I do not understand what this would change... and it doesn't do anything.