2

我想在我的应用程序中使用颜色选择器对话框 - 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]
4

1 回答 1

3

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

于 2012-09-12T07:58:32.163 回答