vala中的GtkColorChooser对话框

时间:2012-09-12 07:46:41

标签: vala gtk3

我想在我的应用中使用颜色选择器对话框 - https://github.com/satya164/gtk-theme-config

我在vala中找不到任何有关ColorChooserDialog的文档。目前我正在使用颜色按钮来选择颜色。但是我在编译时得到了以下弃用警告,我正在使用Vala 0.16.1和GTK3.6(警告不会出现在GTK3.4中)。我在使用ColorChooser对话框时找不到示例。如果有人可以帮我实现ColorChooserDialog,我将非常感激。

valac --pkg gtk+-3.0 -X -lm gtk-theme-config.vala -o gtk-theme-config
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c: In function ‘theme_pref_window_set_values’:
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1013:2: warning: ‘gtk_color_button_set_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:100): Use 'gtk_color_chooser_set_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1016:2: warning: ‘gtk_color_button_set_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:100): Use 'gtk_color_chooser_set_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1019:2: warning: ‘gtk_color_button_set_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:100): Use 'gtk_color_chooser_set_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1022:2: warning: ‘gtk_color_button_set_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:100): Use 'gtk_color_chooser_set_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1025:2: warning: ‘gtk_color_button_set_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:100): Use 'gtk_color_chooser_set_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c: In function ‘theme_pref_window_on_selected_color_set’:
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1499:2: warning: ‘gtk_color_button_get_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:103): Use 'gtk_color_chooser_get_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c: In function ‘theme_pref_window_on_panelbg_color_set’:
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1519:2: warning: ‘gtk_color_button_get_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:103): Use 'gtk_color_chooser_get_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c: In function ‘theme_pref_window_on_panelfg_color_set’:
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1536:2: warning: ‘gtk_color_button_get_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:103): Use 'gtk_color_chooser_get_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c: In function ‘theme_pref_window_on_menubg_color_set’:
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1553:2: warning: ‘gtk_color_button_get_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:103): Use 'gtk_color_chooser_get_rgba' instead [-Wdeprecated-declarations]
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c: In function ‘theme_pref_window_on_menufg_color_set’:
/home/satya/Workspace/gtk-theme-config/gtk-theme-config.vala.c:1570:2: warning: ‘gtk_color_button_get_rgba’ is deprecated (declared at /usr/include/gtk-3.0/gtk/gtkcolorbutton.h:103): Use 'gtk_color_chooser_get_rgba' instead [-Wdeprecated-declarations]

1 个答案:

答案 0 :(得分:2)

将您的Vala升级到最新的0.17.x版本(或暂时忽略警告 - 它们没有造成任何伤害)。