2013/6/1 Satyajit Sahoo <satyajit.ha...@gmail.com>

> I want to use an alpha value in the color buttons in my app -
> https://github.com/satya164/elegance-colors
>
> Currently I'm using colorbutton.set_use_alpha (true);, as documented in
> http://www.valadoc.org/#!api=gtk+-3.0/Gtk.ColorButton
>
> But, while compiling, I get warnings saying,
>
> /home/satya/Workspace/elegance-colors/elegance-colors-prefs.vala.c:4706:2:
> warning: ‘gtk_color_button_set_use_alpha’ is deprecated (declared at
> /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:95): Use
> 'gtk_color_chooser_set_use_alpha' instead [-Wdeprecated-declarations]
>
> The code samples in the valadoc website are outdated and the sample on
> gnome's website doesn't use alpha. Can anyone help me fix the warning
> messages?
>
> I'm using GTK 3.8 and Vala 0.20.1.
> --
> Satyajit Sahoo
> Profile - Facebook <http://facebook.com/satya164>,
> Google+<http://plus.google.com/u/0/114564489020097923600>
> Artwork - DeviantArt <http://satya164.deviantart.com>
> _______________________________________________
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>

Hi,

looking at the documentation, it seems that the "use-alpha" property
was moved out of ColorButton (and probably other color widgets)
and unified in the ColorChooser interface, but left in those concrete
classes for backwards compatibility. The problem I think is that
when you do "myButton.set_use_alpha()" valac cannot know if you
mean ColorButton::set_use_alpha or ColorChooser::set_use_alpha
and just defaults to the former.

Normally I would tell you to just ignore warnings that gcc spits out
(as there are others caused by bugs in valac), but if you really want
them gone you could remove all the use-alpha related calls from
the ColorButton class in the gtk3 vapi (although others compiling
your project would still get them).

Jonas
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to