Welcome, Guest!!

Date: Fri, Jul 19th 2024

  Login Join GTK

Gtk Screen size in pixels

Topic Started By: ldries46       Created: Thu, 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;
      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);
   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.

Decoding the Battle between Cloud Transformation and Cloud Migration!

Decoding the Battle between Cloud Transformation and Cloud Migration!

138 views5 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

308 views8 months 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

315 views10 months ago

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

Benefits of integrating chatgpt in mobile app

335 views1 year ago

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

GtkPrintUnixDialog not available on linux?

1.2K 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?

770 views2 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

969 views3 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.5K views3 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

841 views3 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]

1K views3 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.4K 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.2K 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.2K 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.5K 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

931 views4 years ago

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

Austin software design

1.1K views4 years ago

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

Top luxury hotels in glasgow

915 views4 years ago

Best Hotel Deals Glasgow | Affordable Hotels | Top Luxury Hotels: As a popular tourist destination that&...[Read more]

Benefits of Using Mobile Application for Small Business

1.3K views4 years ago

Mobile Application is one of the best platforms that businesses have in this technological world. ...[Read more]

Voip providers allentown

1K views4 years ago

VoIP Providers | Business Phone System | Philadelphia Telecom: For local businesses looking for a business phone ...[Read more]