Recent

Author Topic: [Solved] Combobox doesn't display text after dropdown  (Read 1072 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
[Solved] Combobox doesn't display text after dropdown
« on: October 06, 2022, 03:31:03 pm »
Lazarus 2.2.4 with FPC 3.2.2 on Linux x86_64 Debian 10 "Buster" using GTK2.

I think this is an old one that's been mentioned by a number of people, and I'd like to know its status before lobbing noise into the bugtracker.

If a populated combobox is dropped-down and an item is selected, when the dropdown closes no text is visible in the editable portion of the control. Clicking on any part of the editable field, or tabbing through controls on the form, displays the text.

This does not happen on Qt, other widgetsets untested.

So far, the only way I've found of fixing this under software control is to do something like

Code: Pascal  [Select][+][-]
  1. procedure TJds6600Form.ComboBoxPortNameCloseUp(Sender: TObject);
  2.  
  3. begin
  4. {$ifdef LCLGTK2 }
  5. // Nasty bug in here: the value isn't displayed unless the text is clicked on.
  6. // Might be GTK2-specific or related to a specific trunk version, below is fugly
  7. // but works round it.
  8.  
  9.   Application.Minimize;
  10.   Application.BringToFront
  11. {$endif LCLGTK2 }
  12. end { TJds6600Form.ComboBoxPortNameCloseUp } ;
  13.  

Any comments would be appreciated.

MarkMLl




MarkMLl
« Last Edit: October 07, 2022, 10:11:44 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

tetrastes

  • Sr. Member
  • ****
  • Posts: 473
Re: Combobox doesn't display text after dropdown
« Reply #1 on: October 06, 2022, 10:42:33 pm »
Cannot confirm at Ubuntu 22.04 x86_64 Lazarus 2.2.4 FPC 3.2.2 LCLgtk2.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Combobox doesn't display text after dropdown
« Reply #2 on: October 07, 2022, 04:03:34 pm »
I've just checked it on Debian 11 "Bullseye" on an RPi and can confirm that it appears to have been fixed.

I've seen similar problems with dialog(ue) boxes which were already leading me to suspect that it was more of a library problem than a Lazarus one.

I've not yet checked with Bullseye on an x86_64 system, but will do so to make sure.

Later: I can confirm that Debian 11 on x86_64 is fine.

MarkMLl
« Last Edit: October 07, 2022, 10:11:17 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Arioch

  • Sr. Member
  • ****
  • Posts: 421
Re: Combobox doesn't display text after dropdown
« Reply #3 on: October 07, 2022, 06:44:31 pm »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Combobox doesn't display text after dropdown
« Reply #4 on: October 07, 2022, 07:47:44 pm »
I fail to see what that's got to do with it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Arioch

  • Sr. Member
  • ****
  • Posts: 421
Re: Combobox doesn't display text after dropdown
« Reply #5 on: October 07, 2022, 07:57:10 pm »
One one hand, Lazarus uses API deprecated more than 10 years ago only existing because people were lazy to remove it, whose name suggests relation to text charsets (and erratic transcoding might destroy text).

One another hand, you experience a shroedingbug with missing text ("no text is visible") that is reproduced on a specific set of OS+GTK2 but is not repeated on a different library or one a different platform.

Essentially, LCL is gambling upon eveyrone's being lazy. Maybe unrelated, but personally trying supported API would be the first thing when i hit shroedingbugs like this :-)   Just for a sake of reducing unknowns.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Combobox doesn't display text after dropdown
« Reply #6 on: October 07, 2022, 10:10:34 pm »
One another hand, you experience a shroedingbug with missing text ("no text is visible") that is reproduced on a specific set of OS+GTK2 but is not repeated on a different library or one a different platform.

Not at all. It's quite clearly related to a range of GTK revisions on every platform... and since it's the text that disappears rather than the bug the appropriate term is Shroedingtext.

Furthermore, no criticism of GTK on Linux was intended or implied. Most of the thread to which you referred related to GTK on Windows, which can hardly be called the most popular widgetset combination.

As the originator of this thread I'd prefer not to get into a discussion of whether the LCL developers should have put more work into GTK3- or wherever that project is these days- or Qt5 (ditto).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018