Hiding the window caption lazarus / 32-Linux ---------------------------------------------------------------------- MarkMLl · 2023-02-23 18:25 This code suffices to toggle the display of the application caption Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     'z': begin           case BorderStyle of             bsSizeable: BorderStyle := bsNone           otherwise             BorderStyle := bsSizeable           end;           testCard(true)         end;  but only works reliably for Qt/Qt5 (i.e. not GTK2/GTK3). Does anybody have anything better? MarkMLl ---------------------------------------------------------------------- Blaazen · 2023-02-23 20:08 It seems I found GTk2 hack: set Constraints.MinHeight and Constraints.MinWidth to something (in OI or in code). GTk2 probably sets Width and Height to zero somewhere during the switching the BorderStyle. ---------------------------------------------------------------------- MarkMLl · 2023-02-24 08:08 Is that using the contsraint of the form, or getting at the caption in some way? Trying that using code below (Laz 2.2.4, FPC 3.2.2) using GTK2 on KDE hides/unhides the entire window. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     'z': begin           with Constraints do begin             MinWidth := 0;           MinHeight := 0           end;           case BorderStyle of             bsSizeable: BorderStyle := bsNone           otherwise           BorderStyle := bsSizeable           end;           testCard(true)         end;  Added detail: what I'm doing isn't entirely cosmetic, since it makes sure that space on the physical display being calibrated isn't occupied by the caption. I can work around the problem by using Qt5 as the widget set, although that does mean that I can't run it on the old laptop I was hoping to use... I've got a slightly rickety optical bench setup and there's a big advantage to being able to keep the video generation well separated from the computer I'm sitting at. MarkMLl ---------------------------------------------------------------------- zeljko · 2023-02-24 11:18 From Qt world: When changing windowFlags (that's border etc) you should hide(), set new windowflags, show(). Try that with gtk2, x11 philosophy should be same. ---------------------------------------------------------------------- MarkMLl · 2023-02-24 12:07 With GTK2, the entire form/window appears to be being hidden (I didn't remember that behaviour, but I've upgraded the distro since writing this and there was a point-level libgtk upgrade). It's the same irrespective of the presence or hide/show (I've stuck the form name in there to be absolutely unambiguous), of the constraint change, or of the APM I added for good measure. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     'z': beginForm1.Hide;{           with Constraints do begin             MinWidth := 0;             MinHeight := 0           end; }           case BorderStyle of             bsSizeable: BorderStyle := bsNone         otherwise             BorderStyle := bsSizeable           end;Form1.Show;Application.ProcessMessages;           testCard(true)         end;  Everything else works fine: testcard() basically paints a bullseye with rings at adjustable positions. I wonder whether there's any overlap here with people who've used circular output which presumably didn't have a caption? In any event, Qt5 works and I suspect I might have to live with that. MarkMLl ---------------------------------------------------------------------- Blaazen · 2023-02-24 15:14 Why you tried zeros? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   with Constraints do begin             MinWidth := 0;             MinHeight := 0           end;I meant non-zero. But I tested it by setting constraints in OI. ---------------------------------------------------------------------- MarkMLl · 2023-02-24 17:07 The reason I put it in code was that I've also been testing this on GTK1 (for the Hell of it, and because the laptop I'm using to derive the device still has a usable copy of a suitably-old Lazarus/FPC) and it saves putting anything which might be unsupported in the .lfm. Anyway, the result with the minimum values set to 1 was definitely interesting: either with or without the hide/show and APM the first z caused the caption to disappear and the second brought it back (yay!). However the third z hid the entire form, the fourth brought it back and so on. MarkMLl ---------------------------------------------------------------------- MarkMLl · 2023-02-24 18:08 I'm tacking a "published" version of the project on as a zipfile, in case anybody wants to play with it. However I'd emphasise that this is for the sake of interest only, and that I am definitely not stuck because of this. I've set it to talk to stdin/out rather than Telnet and believe it's complete, but there might be minor directory issues. MarkMLl