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:a37:a6c3:: with SMTP id p186mr2373194qke.237.1599129078359; Thu, 03 Sep 2020 03:31:18 -0700 (PDT) X-Received: by 2002:a05:620a:141a:: with SMTP id d26mr2343545qkj.217.1599129078182; Thu, 03 Sep 2020 03:31:18 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 3 Sep 2020 03:31:17 -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=2001:67c:2628:647:a:0:0:179; posting-account=SlBMPAoAAACF-curIg-tGtkPCxnpNsBn NNTP-Posting-Host: 2001:67c:2628:647:a:0:0:179 References: <5efd6ceb$0$1439$e4fe514c@news.kpn.nl> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Gtk ada Sizes in pixels From: riya patel Injection-Date: Thu, 03 Sep 2020 10:31:18 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:60053 List-Id: On Thursday, 2 July 2020 10:44:01 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;