From: ldries46 <bertus.dries@planet.nl>
Subject: Gtk ada Sizes in pixels
Date: Thu, 2 Jul 2020 07:13:15 +0200 [thread overview]
Message-ID: <5efd6ceb$0$1439$e4fe514c@news.kpn.nl> (raw)
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 reply other threads:[~2020-07-02 5:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 5:13 ldries46 [this message]
2020-07-02 14:23 ` Gtk ada Sizes in pixels 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
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