From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:aed:3e44:: with SMTP id m4mr37640527qtf.33.1600524566845; Sat, 19 Sep 2020 07:09:26 -0700 (PDT) X-Received: by 2002:a37:a94b:: with SMTP id s72mr36168108qke.383.1600524566124; Sat, 19 Sep 2020 07:09:26 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 19 Sep 2020 07:09:25 -0700 (PDT) In-Reply-To: <5efd6ceb$0$1439$e4fe514c@news.kpn.nl> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=103.85.11.110; posting-account=bWHlUQoAAAC7v-GiJ64eEhxgkxAE3fB1 NNTP-Posting-Host: 103.85.11.110 References: <5efd6ceb$0$1439$e4fe514c@news.kpn.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5b4cbae8-2b00-4557-9b56-d6c45ff8f019o@googlegroups.com> Subject: Re: Gtk ada Sizes in pixels From: erchetan33@gmail.com Injection-Date: Sat, 19 Sep 2020 14:09:26 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:60218 List-Id: On Thursday, July 2, 2020 at 10:44:01 AM UTC+5:30, ldries46 wrote: > I have a problem with Sizes of Gtk Windows. > On a screen of 3840 * 2160 pixels I want a Main window of about 2000 *=20 > 1200 pixels. When I run the program where the initiation code=C2=A0 is he= rby=20 > given (as far a sizes are involved) it looks like a window of about 3000= =20 > * 2000 pixels what should I do to get real pixels >=20 > in the spec: > =C2=A0=C2=A0 Mainsize_H=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 : Gint :=3D 2000; -- Width of the main window > =C2=A0=C2=A0 Mainsize_V=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 : Gint :=3D 1200; -- Height of the main window >=20 > from another package: >=20 > =C2=A0=C2=A0 type Screen_resolution is record > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 width=C2=A0 : integer :=3D 0; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 heigth : integer :=3D 0; > =C2=A0=C2=A0 end record; >=20 >=20 > =C2=A0=C2=A0 procedure Init(MainWindow : access Main_Window_Record'Class= ) is > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pragma Suppress (All_Checks); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Scr=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 : Screen_resolution; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Pixmaps_Dir : constant String :=3D "pixma= ps/"; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FontDesc=C2=A0=C2=A0=C2=A0 : Pango_Font_D= escription; > =C2=A0=C2=A0 begin > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Gtk.Window.Initialize (MainWindow, Window= _Toplevel); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MainWindow.Set_Title (To_String(Lan_Windo= w_Title(Lan))); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Set_Position (MainWindow, Win_Pos_Center)= ; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Set_Modal (MainWindow, False); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Set_Resizable (MainWindow, True); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Scr :=3D Resolution; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if Scr.width < integer(Mainsize_H) and Sc= r.width /=3D 0 then > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MainSize_H :=3D Gint(Sc= r.Width); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 end if; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if Scr.heigth < integer(Mainsize_V) and S= cr.heigth /=3D 0 then > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MainSize_V :=3D Gint(Sc= r.heigth); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 end if; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Set_Default_Size (MainWindow, Mainsize_H,= Mainsize_V); > ... > ... > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Get_Size(MainWindow, W, H); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --Debug > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print(Scr.width); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print_Line(Scr.heigth); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print(integer(Mainsize_H)); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print_Line(integer(Mainsize_V)); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print(integer(W)); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Print_Line(integer(H)); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ---- > ... > ... > =C2=A0=C2=A0 end Init;