Welcome, Guest!!

Date: Tue, Dec 10th 2024
Time:

  Login Join GTK
 
 

Gtk Screen size in pixels

Topic Started By: ldries46       Created: Jul 2nd, 2020, 12:42 pm


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;
 

×

Subscribe to get notifications when I create new topics by clicking the SUBSCRIBE button at the top of this page if you have not already subscribed. Thanks.




Related Topic (s) in Programming section.

The Future of Cutting-Edge App Development: Key Trends

32 views7 days ago

Cutting-edge app development is at the forefront of innovation, and staying updated with the latest ...[Read more]


Tokenization Platform Development Transforming Assets for a Digital Future

Tokenization Platform Development Transforming Assets for a Digital Future

70 views1 month ago

Looking to unlock the potential of your assets? Hivelance, a leading tokenization platform development company, ...[Read more]


Agen Judi Togel Online Taruhan Angka 4d Terbaik dan Terpercaya

161 views3 months ago

Agen Judi Togel Online Taruhan Angka 4d Terbaik dan Terpercaya DAFTAR KLIK DISINI SEKARANG DAFTAR ...[Read more]


Decoding the Battle between Cloud Transformation and Cloud Migration!

Decoding the Battle between Cloud Transformation and Cloud Migration!

278 views10 months ago

🔍 Eager to unravel the critical differences between Cloud Transformation and Cloud Migration? Dive into the ...[Read more]


How to set up HTTPS on localhost or local server made simple

How to set up HTTPS on localhost or local server made simple

474 views1 year ago

I didn’t think that there will be a time where websites would be ...[Read more]


Effective strategy for B2B Email Marketing in Dubai

443 views1 year ago

Creating an effective B2B email marketing strategy for Dubai, or any market, requires a ...[Read more]


Benefits of integrating chatgpt in mobile app

483 views2 years ago

You might be looking for a secure and efficient way to automate customer conversations on ...[Read more]


GtkPrintUnixDialog not available on linux?

1.4K views2 years ago

Hi I'm trying to use gtk on linux (ubuntu 20.04). GtkPrintUnixDialog not available on linux? ...[Read more]


What are the advantages of Python programming?

921 views3 years ago

Benefits of Python Programming: • Python is Embeddable: There are many advantages of Python ...[Read more]


Filechooser Show the files within a certain foder

1.1K views4 years ago

When using Set_Current_Folder I get a window in which the Folder I enter ...[Read more]


OTT App Development Company | OTT Video Delivery Solutions

OTT App Development Company | OTT Video Delivery Solutions

1.8K views4 years ago

At Oodles Technologies, we deliver customer-centric OTT solutions that are unique and add value to ...[Read more]


Custom and Integrated Supply Chain Solutions

963 views4 years ago

I want to set up my software solutions for transportation and logistics management. However, the ...[Read more]


Problem with gtk_grid_attach_next_to (gtk3.24.24) using Solus linux [solved]

1.2K views4 years ago

I have a vertical grid of 4 buttons. Clicking on a button adds a grid entry ...[Read more]


Get boxes update if nothing is clicked

1.5K views4 years ago

I am a student who is doing an internship in a company, for this I ...[Read more]


Build a Competitive Marketplace App

1.4K views4 years ago

If you want to Build a Competitive Marketplace App then find the best app development ...[Read more]


Why are Indian App Developers Seamless for App Development?

1.4K views4 years ago

Technologies have shaped the entire world differently, and mobile apps stand the first in this ...[Read more]


How to build a successful software development team in the USA?

2.9K views4 years ago

To build successful software for the client, a software development company needs an incredible team. ...[Read more]


Lease to own dslr camera

1.1K views4 years ago

Video Cameras on Finance | Lease to own DSLR Camera – Instant Finance 24: We carry a ...[Read more]


Austin software design

1.2K views4 years ago

Austin Design Studio • Enterprise Software Companies • Innovation Consulting • Rocksauce: Design thinking methodology ...[Read more]