[Spice-devel] [PATCH spice-gtk] usb-device-widget: Remove deprecated GTK_MISC

Pavel Grunt pgrunt at redhat.com
Mon Jun 26 07:39:05 UTC 2017


On Fri, 2017-06-23 at 11:39 -0400, Frediano Ziglio wrote:
> > 
> > ---
> >  src/usb-device-widget.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c
> > index e87bdff..2d07468 100644
> > --- a/src/usb-device-widget.c
> > +++ b/src/usb-device-widget.c
> > @@ -208,7 +208,7 @@ static GObject
> > *spice_usb_device_widget_constructor(
> >      str = g_strdup_printf("<b>%s</b>", _("Select USB devices to
> > redirect"));
> >      gtk_label_set_markup(GTK_LABEL (priv->label), str);
> >      g_free(str);
> > -    gtk_misc_set_alignment(GTK_MISC(priv->label), 0.0, 0.5);
> > +    g_object_set(G_OBJECT(priv->label), "xalign", 0.0, "yalign",
> > 0.5, NULL);
> >      gtk_container_add(GTK_CONTAINER(self), priv->label);
> >  
> >      priv->manager = spice_usb_device_manager_get(priv->session,
> > &err);
> 
> Why not using gtk_label_set_xalign/gtk_label_set_yalign ?

I followed the documentation:
"gtk_misc_set_alignment has been deprecated since version 3.14 and
should not be used in newly-written code.
Use GtkWidget's alignment (“halign” and “valign”) and margin
properties or GtkLabel's “xalign” and “yalign” properties."

Pavel

> 
> Frediano


More information about the Spice-devel mailing list