comp.lang.ada
 help / color / mirror / Atom feed
* Different screen parameters
@ 2020-06-23  6:31 ldries46
  2020-06-23  9:14 ` Luke A. Guest
  2020-06-23  9:54 ` Jeffrey R. Carter
  0 siblings, 2 replies; 7+ messages in thread
From: ldries46 @ 2020-06-23  6:31 UTC (permalink / raw)


I am using a high definition screen 4K (3840 * 2160 pixels) and two 
computers one with a graphic card which can handle this resolution and 
an older one which can handle up to 1920 * 1080. (the first on Windows 
10 the second on Linux Ubuntu). I want both computers capable of running 
my programs even if I define a the window on 2000 * 1200 for a Gtk 
project. On the computer that can handle the resolution the there is of 
course no problem. On the other the screen is window is to big for the 
resolution and is shown only partly (of course).

My question is:
Is there an Ada library that is able to somehow read the  maximum sizes 
of the screen in pixels so I can firstly maximize my values for size 
definition in Gtk.

I already tried:
Maximize(Mainwindow);
Get_Size(MainWindow, Height, Width);

The result was 200 * 200

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

* Re: Different screen parameters
  2020-06-23  6:31 Different screen parameters ldries46
@ 2020-06-23  9:14 ` Luke A. Guest
  2020-06-23  9:54 ` Jeffrey R. Carter
  1 sibling, 0 replies; 7+ messages in thread
From: Luke A. Guest @ 2020-06-23  9:14 UTC (permalink / raw)


On 23/06/2020 07:31, ldries46 wrote:

On KDE, you end up having to scale up the second window to the same
resolution although it doesn't stay and I've had to use a script to
reset the displays.

xrandr --output DisplayPort-0 --auto --scale 1x1 --primary --output
DisplayPort-1 --auto --scale 4x4 --right-of DisplayPort-0
xrandr --output DisplayPort-0 --auto --scale 1x1 --primary --output
DisplayPort-1 --auto --scale 2x2 --right-of DisplayPort-0

The first scales up the screen and the second scales it back down to the
correct size, this is so the KDE pager shows up correctly.

You'll then need to change font sizes.

You'll need to set up env vars as well for QT and GTK apps so they scale
properly, even then hard coded apps won't scale.

QT_AUTO_SCREEN_SCALE_FACTOR=0
GDK_SCALE=2

This whole HiDPI stuff on Linux is a mess.

> I am using a high definition screen 4K (3840 * 2160 pixels) and two
> computers one with a graphic card which can handle this resolution and
> an older one which can handle up to 1920 * 1080. (the first on Windows
> 10 the second on Linux Ubuntu). I want both computers capable of running
> my programs even if I define a the window on 2000 * 1200 for a Gtk
> project. On the computer that can handle the resolution the there is of
> course no problem. On the other the screen is window is to big for the
> resolution and is shown only partly (of course).
> 
> My question is:
> Is there an Ada library that is able to somehow read the  maximum sizes
> of the screen in pixels so I can firstly maximize my values for size
> definition in Gtk.
> 
> I already tried:
> Maximize(Mainwindow);
> Get_Size(MainWindow, Height, Width);
> 
> The result was 200 * 200


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

* Re: Different screen parameters
  2020-06-23  6:31 Different screen parameters ldries46
  2020-06-23  9:14 ` Luke A. Guest
@ 2020-06-23  9:54 ` Jeffrey R. Carter
  2020-06-24  9:29   ` ldries46
  1 sibling, 1 reply; 7+ messages in thread
From: Jeffrey R. Carter @ 2020-06-23  9:54 UTC (permalink / raw)


On 6/23/20 8:31 AM, ldries46 wrote:
> 
> My question is:
> Is there an Ada library that is able to somehow read the  maximum sizes of the 
> screen in pixels so I can firstly maximize my values for size definition in Gtk.

Gnoga has package Gnoga.Gui.Screen that provides this kind of information.

-- 
Jeff Carter
"I like it when the support group complains that they have
insufficient data on mean time to repair bugs in Ada software."
Robert I. Eachus
91

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

* Re: Different screen parameters
  2020-06-23  9:54 ` Jeffrey R. Carter
@ 2020-06-24  9:29   ` ldries46
  2020-06-24 12:16     ` Jeffrey R. Carter
  0 siblings, 1 reply; 7+ messages in thread
From: ldries46 @ 2020-06-24  9:29 UTC (permalink / raw)


Op 23-6-2020 om 11:54 schreef Jeffrey R. Carter:
> On 6/23/20 8:31 AM, ldries46 wrote:
>>
>> My question is:
>> Is there an Ada library that is able to somehow read the maximum 
>> sizes of the screen in pixels so I can firstly maximize my values for 
>> size definition in Gtk.
>
> Gnoga has package Gnoga.Gui.Screen that provides this kind of 
> information.
>
I found the procedures that can possibly give me the correct result bit 
I cannot find an example how tu use them in a Gtk environment. 
especially the value op the type Gnoga.Gui.Window.Window_Type I need

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

* Re: Different screen parameters
  2020-06-24  9:29   ` ldries46
@ 2020-06-24 12:16     ` Jeffrey R. Carter
  2020-06-26  7:23       ` ldries46
  0 siblings, 1 reply; 7+ messages in thread
From: Jeffrey R. Carter @ 2020-06-24 12:16 UTC (permalink / raw)


On 6/24/20 11:29 AM, ldries46 wrote:
> Op 23-6-2020 om 11:54 schreef Jeffrey R. Carter:
>> On 6/23/20 8:31 AM, ldries46 wrote:
>>>
>>> My question is:
>>> Is there an Ada library that is able to somehow read the maximum sizes of the 
>>> screen in pixels so I can firstly maximize my values for size definition in Gtk.
>>
>> Gnoga has package Gnoga.Gui.Screen that provides this kind of information.
>>
> I found the procedures that can possibly give me the correct result bit I cannot 
> find an example how tu use them in a Gtk environment. especially the value op 
> the type Gnoga.Gui.Window.Window_Type I need

Mainly, I was saying that you could use Gnoga if GTKAda doesn't provide the 
information you need.

These would require you to initialize a Gnoga application:

procedure Get_Screen_Size (Height : out Positive; Width : out Positive) is
    Window : Gnoga.Gui.Window.Window_Type;
begin -- Get_Screen_Size
    Gnoga.Application.Singleton.Initialize (Main_Window => Window);
    Height := Gnoga.Gui.Screen.Height (Window);
    Width  := Gnoga.Gui.Screen.Width  (Window);
end Get_Screen_Size;

Possibly you could use this from a GTKAda application.

On my system, these functions return a height of 1080 and a width of 1920.

-- 
Jeff Carter
"When and now is this guitar piece from Stottlemeyer?
Yes, it's with Mr. Dog in Gertrude's pinball forest."
The World's Funniest Joke
133

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

* Re: Different screen parameters
  2020-06-24 12:16     ` Jeffrey R. Carter
@ 2020-06-26  7:23       ` ldries46
  2020-06-26 11:47         ` ldries46
  0 siblings, 1 reply; 7+ messages in thread
From: ldries46 @ 2020-06-26  7:23 UTC (permalink / raw)


Op 24-6-2020 om 14:16 schreef Jeffrey R. Carter:
> On 6/24/20 11:29 AM, ldries46 wrote:
>> Op 23-6-2020 om 11:54 schreef Jeffrey R. Carter:
>>> On 6/23/20 8:31 AM, ldries46 wrote:
>>>>
>>>> My question is:
>>>> Is there an Ada library that is able to somehow read the maximum 
>>>> sizes of the screen in pixels so I can firstly maximize my values 
>>>> for size definition in Gtk.
>>>
>>> Gnoga has package Gnoga.Gui.Screen that provides this kind of 
>>> information.
>>>
>> I found the procedures that can possibly give me the correct result 
>> bit I cannot find an example how tu use them in a Gtk environment. 
>> especially the value op the type Gnoga.Gui.Window.Window_Type I need
>
> Mainly, I was saying that you could use Gnoga if GTKAda doesn't 
> provide the information you need.
>
> These would require you to initialize a Gnoga application:
>
> procedure Get_Screen_Size (Height : out Positive; Width : out 
> Positive) is
>    Window : Gnoga.Gui.Window.Window_Type;
> begin -- Get_Screen_Size
>    Gnoga.Application.Singleton.Initialize (Main_Window => Window);
>    Height := Gnoga.Gui.Screen.Height (Window);
>    Width  := Gnoga.Gui.Screen.Width  (Window);
> end Get_Screen_Size;
>
> Possibly you could use this from a GTKAda application.
>
> On my system, these functions return a height of 1080 and a width of 
> 1920.
>
It looked nice but in my environment (Gtk) it looks like shooting with a 
Cannon at a fly.

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

* Re: Different screen parameters
  2020-06-26  7:23       ` ldries46
@ 2020-06-26 11:47         ` ldries46
  0 siblings, 0 replies; 7+ messages in thread
From: ldries46 @ 2020-06-26 11:47 UTC (permalink / raw)


Op 26-6-2020 om 9:23 schreef ldries46:
> Op 24-6-2020 om 14:16 schreef Jeffrey R. Carter:
>> On 6/24/20 11:29 AM, ldries46 wrote:
>>> Op 23-6-2020 om 11:54 schreef Jeffrey R. Carter:
>>>> On 6/23/20 8:31 AM, ldries46 wrote:
>>>>>
>>>>> My question is:
>>>>> Is there an Ada library that is able to somehow read the maximum 
>>>>> sizes of the screen in pixels so I can firstly maximize my values 
>>>>> for size definition in Gtk.
>>>>
>>>> Gnoga has package Gnoga.Gui.Screen that provides this kind of 
>>>> information.
>>>>
>>> I found the procedures that can possibly give me the correct result 
>>> bit I cannot find an example how tu use them in a Gtk environment. 
>>> especially the value op the type Gnoga.Gui.Window.Window_Type I need
>>
>> Mainly, I was saying that you could use Gnoga if GTKAda doesn't 
>> provide the information you need.
>>
>> These would require you to initialize a Gnoga application:
>>
>> procedure Get_Screen_Size (Height : out Positive; Width : out 
>> Positive) is
>>    Window : Gnoga.Gui.Window.Window_Type;
>> begin -- Get_Screen_Size
>>    Gnoga.Application.Singleton.Initialize (Main_Window => Window);
>>    Height := Gnoga.Gui.Screen.Height (Window);
>>    Width  := Gnoga.Gui.Screen.Width  (Window);
>> end Get_Screen_Size;
>>
>> Possibly you could use this from a GTKAda application.
>>
>> On my system, these functions return a height of 1080 and a width of 
>> 1920.
>>
> It looked nice but in my environment (Gtk) it looks like shooting with 
> a Cannon at a fly.
>
In the meantime I found in the Gtk library (Gdk_Windows, _Display, 
_Screen and _Monitor) some thing that looked promising till the moment 
that I looked them up and the message was that they were depreciated 
from v 3.22 everywhere but in _monitor which is not in the latest 
version I found on AdaCore

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

end of thread, other threads:[~2020-06-26 11:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23  6:31 Different screen parameters ldries46
2020-06-23  9:14 ` Luke A. Guest
2020-06-23  9:54 ` Jeffrey R. Carter
2020-06-24  9:29   ` ldries46
2020-06-24 12:16     ` Jeffrey R. Carter
2020-06-26  7:23       ` ldries46
2020-06-26 11:47         ` ldries46

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