comp.lang.ada
 help / color / mirror / Atom feed
* Gtk ada Sizes in pixels
@ 2020-07-02  5:13 ldries46
  2020-07-02 14:23 ` Dennis Lee Bieber
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: ldries46 @ 2020-07-02  5:13 UTC (permalink / 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;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-19 14:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-09-19 14:09 ` erchetan33

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox