I have a problem with Sizes of Gtk Windows. The programming language is Ada.
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;