comp.lang.ada
 help / color / mirror / Atom feed
From: ldries46 <bertus.dries@planet.nl>
Subject: Re: Gtk ada Sizes in pixels
Date: Fri, 3 Jul 2020 11:54:00 +0200	[thread overview]
Message-ID: <5eff0038$0$1479$e4fe514c@news.kpn.nl> (raw)
In-Reply-To: <5efe032c$0$1456$e4fe514c@news.kpn.nl>

Op 2-7-2020 om 17:54 schreef ldries46:
> Op 2-7-2020 om 16:23 schreef Dennis Lee Bieber:
>> On Thu, 2 Jul 2020 07:13:15 +0200, ldries46 <bertus.dries@planet.nl>
>> declaimed the following:
>>
>>> 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
>>>
>>     Isn't this essentially the same question you asked on June 23 in
>>
>> Message-ID: <5ef1a1cc$0$1475$e4fe514c@news.kpn.nl>
>>
>> !> 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).
>>
>>     If not, they are very closely related... and probably not Ada 
>> specific
>> (how does a C/C++ GTK experiment behave?)
>>
>> https://lazka.github.io/pgi-docs/Gdk-3.0/classes/WindowAttr.html
>> https://lazka.github.io/pgi-docs/Gdk-3.0/classes/Geometry.html
>> """
>> The other useful fields are the min_aspect and max_aspect fields; these
>> contain a width/height ratio as a floating point number. If a geometry
>> widget is set, the aspect applies to the geometry widget rather than the
>> entire window. The most common use of these hints is probably to set
>> min_aspect and max_aspect to the same value, thus forcing the window to
>> keep a constant aspect ratio.
>> """
>>
>>     In a quick Google -- I don't seem to find aspect exposed
>> http://docs.adacore.com/live/wave/gtkada/html/gtkada_rm/index.html
>> other than in Gtk.Aspect_Frame
>>
>>
> No it is not the same question but it is in line. In the mean time 
> from  answers then I found first GtkWindow. Get_Size which did not 
> gave a correct answer at the moment I needed it. But from there I 
> found Gdk.Windows and Gdk.Screen where all interesting  functions were 
> depreciated from version  and I was directed to a GdkMonitor which was 
> not present in the highest version of GtkAda I could find. From that 
> moment I decided to put the values in the environment variables, the 
> least nice solution. It was then that I realised that the window of my 
> program did not have the correct format ca about 1.5 times as big as 
> expected. So this question is another than earlier but it is an 
> offspring of that other question
>
> I will investigate further
I think I found the latest trouble, now the solution for that
Gtk uses the screen size that is set in windows and not the real screen 
size. For readability on my screen I just set 175%. Now when I used 2000 
pixels the Gtk interpreted that as 3500 pixels . Maybe Gdk.Monitor could 
solve that but I cannot reach that (yet?).

  reply	other threads:[~2020-07-03  9:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
replies disabled

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