comp.lang.ada
 help / color / mirror / Atom feed
* Inconsistency in gtkada (Override_Color)
@ 2017-01-22 11:01 hreba
  2017-01-22 12:32 ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: hreba @ 2017-01-22 11:01 UTC (permalink / raw)


Hi,

I found an inconsistency in Gtkada 2015.

A procedure specification there is

    procedure Override_Color
       (Widget : not null access Gtk_Widget_Record;
        State  : Gtk.Enums.Gtk_State_Flags;
        Color  : Gdk.RGBA.Gdk_RGBA);

The last comment line reads:
"Since: gtk+ 3.0 "state": the state for which to set the color "color": 
the color to assign, or null to undo the effect of previous calls to 
Gtk.Widget.Override_Color".

This is a copy from GTK where the color parameter is indeed a pointer, 
and not a record as Gdk.RGBA.Gdk_RGBA. Several other override-procedures 
show the same inconsistency between specification and description.

Any workaround for resetting the color?
-- 
Frank Hrebabetzky		+49 / 6355 / 989 5070


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

* Re: Inconsistency in gtkada (Override_Color)
  2017-01-22 11:01 Inconsistency in gtkada (Override_Color) hreba
@ 2017-01-22 12:32 ` Simon Wright
  2017-01-23 10:17   ` hreba
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2017-01-22 12:32 UTC (permalink / raw)


hreba <f_hreba@yahoo.com.br> writes:

> I found an inconsistency in Gtkada 2015.
>
> A procedure specification there is
>
>    procedure Override_Color
>       (Widget : not null access Gtk_Widget_Record;
>        State  : Gtk.Enums.Gtk_State_Flags;
>        Color  : Gdk.RGBA.Gdk_RGBA);
>
> The last comment line reads:
> "Since: gtk+ 3.0 "state": the state for which to set the color
> "color": the color to assign, or null to undo the effect of previous
> calls to Gtk.Widget.Override_Color".
>
> This is a copy from GTK where the color parameter is indeed a pointer,
> and not a record as Gdk.RGBA.Gdk_RGBA. Several other
> override-procedures show the same inconsistency between specification
> and description.
>
> Any workaround for resetting the color?

The same inconsistency is present in the Github version[1]. I suppose an
issue should be raised.

Looks to me as though you are supposed to use Gdk.RGBA.Null_RGBA (which
gets translated internally into the needed null).

There are also White_RGBA, Black_RGBA.

[1] https://github.com/AdaCore/gtkada


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

* Re: Inconsistency in gtkada (Override_Color)
  2017-01-22 12:32 ` Simon Wright
@ 2017-01-23 10:17   ` hreba
  2017-01-23 10:38     ` Simon Wright
  0 siblings, 1 reply; 4+ messages in thread
From: hreba @ 2017-01-23 10:17 UTC (permalink / raw)


On 01/22/2017 01:32 PM, Simon Wright wrote:
> hreba <f_hreba@yahoo.com.br> writes:
>
>> I found an inconsistency in Gtkada 2015.
>>
>> A procedure specification there is
>>
>>    procedure Override_Color
>>       (Widget : not null access Gtk_Widget_Record;
>>        State  : Gtk.Enums.Gtk_State_Flags;
>>        Color  : Gdk.RGBA.Gdk_RGBA);
>>
>> The last comment line reads:
>> "Since: gtk+ 3.0 "state": the state for which to set the color
>> "color": the color to assign, or null to undo the effect of previous
>> calls to Gtk.Widget.Override_Color".
>>
>> This is a copy from GTK where the color parameter is indeed a pointer,
>> and not a record as Gdk.RGBA.Gdk_RGBA. Several other
>> override-procedures show the same inconsistency between specification
>> and description.
>>
>> Any workaround for resetting the color?
>
> The same inconsistency is present in the Github version[1]. I suppose an
> issue should be raised.
>
> Looks to me as though you are supposed to use Gdk.RGBA.Null_RGBA (which
> gets translated internally into the needed null).
>
> There are also White_RGBA, Black_RGBA.
>
> [1] https://github.com/AdaCore/gtkada
>

Thanks for the hint.

Should I do something about raising an issue?
-- 
Frank Hrebabetzky		+49 / 6355 / 989 5070

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

* Re: Inconsistency in gtkada (Override_Color)
  2017-01-23 10:17   ` hreba
@ 2017-01-23 10:38     ` Simon Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Wright @ 2017-01-23 10:38 UTC (permalink / raw)


hreba <f_hreba@yahoo.com.br> writes:

> On 01/22/2017 01:32 PM, Simon Wright wrote:
>> hreba <f_hreba@yahoo.com.br> writes:
>>
>>> I found an inconsistency in Gtkada 2015.
>>
>> The same inconsistency is present in the Github version[1]. I suppose
>> an issue should be raised.
>>
>> [1] https://github.com/AdaCore/gtkada
>>
> Should I do something about raising an issue?

Not sure that _I_ should, since I don't use GtkAda & so don't have the
problem! But I will if necessary.

You would have to have a (free) Github account, fairly painless.

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

end of thread, other threads:[~2017-01-23 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-22 11:01 Inconsistency in gtkada (Override_Color) hreba
2017-01-22 12:32 ` Simon Wright
2017-01-23 10:17   ` hreba
2017-01-23 10:38     ` Simon Wright

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