[Github-comments] [geany/geany] Replace Deprecated `gtk_color_selection_dialog_new` with `gtk_color_chooser_dialog_new` (#2340)

LarsGit223 notifications at xxxxx
Sun Oct 6 12:57:12 UTC 2019


LarsGit223 requested changes on this pull request.

The gtk version checks are not correct. This will break on systems between gtk version 3.0 and 3.4.

> @@ -828,20 +842,27 @@ void tools_color_chooser(const gchar *color)
 
 	if (ui_widgets.open_colorsel == NULL)
 	{
+#if (gtk_major_version == 3)	
+		ui_widgets.open_colorsel = gtk_color_chooser_dialog_new(_("Color Chooser"), GTK_WINDOW(main_widgets.window));

```gtk_color_chooser_dialog_new()``` requires at least gtk version 3.4 not 3. You could use ```#if GTK_CHECK_VERSION(3, 4, 0) ... else ... endif``` for a correct version check.

>  			GeanyDocument *doc = document_get_current();
+			g_return_if_fail(doc != NULL);
+#if (gtk_major_version == 3)
+			GdkRGBA color;
+			char hex[8] = { 0 };
+
+			gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(ui_widgets.open_colorsel), &color);
+			sprintf(hex, "#%02X%02X%02X",

This requires version 3.4 not 3.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2340#pullrequestreview-297837203
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20191006/ba1b1ba8/attachment.html>


More information about the Github-comments mailing list