From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail Newsgroups: comp.lang.ada X-Mozilla-News-Host: news://news.kpn.nl:119 From: ldries46 Subject: Gtk ada Sizes in pixels Date: Thu, 2 Jul 2020 07:13:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Message-ID: <5efd6ceb$0$1439$e4fe514c@news.kpn.nl> NNTP-Posting-Host: af557e24.news.kpn.nl X-Trace: G=SnO2t5PK,C=U2FsdGVkX1+EVHE28Hw3aqM1syHXA6fZ9kmbJoIFpM6Uv0JVeYBfT5eDDD6zyGocFviuepDApzQ6neTT19R3joRpWYlvFRZuraHOrw5ci6E= X-Complaints-To: abuse@kpn.nl Xref: reader01.eternal-september.org comp.lang.ada:59304 List-Id: I have a problem with Sizes of Gtk Windows. On a screen of 3840 * 2160 pixels I want a Main window of about 2000 * 1200 pixels. When I run the program where the initiation code  is herby given (as far a sizes are involved) it looks like a window of about 3000 * 2000 pixels what should I do to get real pixels in the spec:    Mainsize_H          : Gint := 2000; -- Width of the main window    Mainsize_V          : Gint := 1200; -- Height of the main window from another package:    type Screen_resolution is record       width  : integer := 0;       heigth : integer := 0;    end record;    procedure Init(MainWindow : access Main_Window_Record'Class) is       pragma Suppress (All_Checks);       Scr         : Screen_resolution;       Pixmaps_Dir : constant String := "pixmaps/";       FontDesc    : Pango_Font_Description;    begin       Gtk.Window.Initialize (MainWindow, Window_Toplevel);       MainWindow.Set_Title (To_String(Lan_Window_Title(Lan)));       Set_Position (MainWindow, Win_Pos_Center);       Set_Modal (MainWindow, False);       Set_Resizable (MainWindow, True);       Scr := Resolution;       if Scr.width < integer(Mainsize_H) and Scr.width /= 0 then          MainSize_H := Gint(Scr.Width);       end if;       if Scr.heigth < integer(Mainsize_V) and Scr.heigth /= 0 then          MainSize_V := Gint(Scr.heigth);       end if;       Set_Default_Size (MainWindow, Mainsize_H, Mainsize_V); ... ...       Get_Size(MainWindow, W, H);       --Debug       Print(Scr.width);       Print_Line(Scr.heigth);       Print(integer(Mainsize_H));       Print_Line(integer(Mainsize_V));       Print(integer(W));       Print_Line(integer(H));       ---- ... ...    end Init;