Merge lp:~bregma/libgrip/lp-1468786 into lp:libgrip

Proposed by Stephen M. Webb on 2015-07-09
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2015-07-09
Approved revision: 97
Merged at revision: 97
Proposed branch: lp:~bregma/libgrip/lp-1468786
Merge into: lp:libgrip
Diff against target: 34 lines (+11/-2)
1 file modified
examples/rectangle-mover/gesture.c (+11/-2)
To merge this branch: bzr merge lp:~bregma/libgrip/lp-1468786
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2015-07-09 Approve on 2015-07-09
Review via email: mp+264313@code.launchpad.net

Commit message

replace deprecated GTK functions with non-deprecated GTK 3.16 calls.

Description of the change

Replaces deprecated GTK functions with non-deprecated GTK 3.16 calls.

To post a comment you must log in.
lp:~bregma/libgrip/lp-1468786 updated on 2015-07-09
97. By Stephen M. Webb on 2015-07-09

replaced GTK functions deprecated in 3.16

Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/rectangle-mover/gesture.c'
2--- examples/rectangle-mover/gesture.c 2014-01-07 18:39:29 +0000
3+++ examples/rectangle-mover/gesture.c 2015-07-09 16:46:29 +0000
4@@ -176,7 +176,8 @@
5 GtkWidget *tv;
6 GtkTreeModel *model;
7 GtkWidget *sw;
8- const GdkRGBA white = { 0xffff, 0xffff, 0xffff, 0xffff };
9+ GtkCssProvider *style;
10+ GtkStyleContext *style_ctx;
11
12 app->da = gtk_drawing_area_new ();
13
14@@ -216,12 +217,20 @@
15
16 gtk_container_add (GTK_CONTAINER (window), hbox);
17
18- gtk_widget_override_background_color (app->da, GTK_STATE_NORMAL, &white);
19+ style = gtk_css_provider_new();
20+ style_ctx = gtk_widget_get_style_context(GTK_WIDGET(app->da));
21+ gtk_css_provider_load_from_data(style,
22+ "* { background-color: #ffffff; }", -1,
23+ NULL);
24+ gtk_style_context_add_provider(style_ctx,
25+ GTK_STYLE_PROVIDER (style),
26+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
27
28 g_signal_connect (app->da, "draw",
29 G_CALLBACK (draw_canvas), NULL);
30
31 subscribe_gestures(app->manager, window, app->da);
32+ g_object_unref(style);
33 return window;
34 }
35

Subscribers

People subscribed via source and target branches