From: riya patel <riyadora121@gmail.com>
Subject: Re: Gtk ada Sizes in pixels
Date: Thu, 3 Sep 2020 03:31:17 -0700 (PDT) [thread overview]
Message-ID: <a33db1fe-1e6f-4755-a3cc-0a3b6e1e2dcdo@googlegroups.com> (raw)
In-Reply-To: <5efd6ceb$0$1439$e4fe514c@news.kpn.nl>
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 *
> 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;
next prev parent reply other threads:[~2020-09-03 10:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 5:13 Gtk ada Sizes in pixels ldries46
2020-07-02 14:23 ` Dennis Lee Bieber
2020-07-02 15:54 ` ldries46
2020-07-03 9:54 ` ldries46
2020-07-03 16:16 ` Dennis Lee Bieber
2020-07-05 7:24 ` ldries46
2020-09-03 10:31 ` riya patel [this message]
2020-09-19 14:09 ` erchetan33
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox