Gstreamer fires signals in a different thread than the gui mainloop. Use something like Idle.add (() => { this.image_button.set_from_stock( Gtk.Stock.MEDIA_PLAY, Gtk.IconSize.BUTTON); return false; }); to run your code in the gui mainloop.
On Thu, Mar 6, 2014 at 12:28 AM, Flavio Danesse <fdane...@gmail.com> wrote: > *Hello, I'm back with questions on the list :) * > > In my application I have gtk3 interface and streamings player gstreamer 1.0 > implemented separately. > Both work correctly separately and jointly work correctly except in the > following case: > > The player emits a signal when the bus changes state of reproduction, that > is, when it comes into play mode, pause, stop, etc.. . . > That signal is captured by the gtk interface to update the image of the > play button - stop. > > *The problem is that when this happens, everything freezes gnome.* > > private void update_state(string state){ > > if (state == "playing"){ > this.image_button.set_from_stock( > Gtk.Stock.MEDIA_STOP, Gtk.IconSize.BUTTON); > } > else{ > this.image_button.set_from_stock( > Gtk.Stock.MEDIA_PLAY, Gtk.IconSize.BUTTON); > } > } > > *I would clean the following warning in my application, but not how to do > it:* > > > /home/flavio/Documentos/JAMediaSuite/UbuntuRadio/vala/UbuntuRadio.vala.c:164:2: > warning: 'gtk_window_set_opacity' is deprecated (declared at > /usr/include/gtk-3.0/gtk/gtkwindow.h:142): Use 'gtk_widget_set_opacity' > instead [-Wdeprecated-declarations] > gtk_window_set_opacity ((GtkWindow*) self, 0.5); > ^ > /home/flavio/Documentos/JAMediaSuite/UbuntuRadio/vala/UbuntuRadio.vala.c: > In function 'main': > > /home/flavio/Documentos/JAMediaSuite/UbuntuRadio/vala/UbuntuRadio.vala.c:377:2: > warning: 'g_type_init' is deprecated (declared at > /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations] > g_type_init (); > ^ > _______________________________________________ > vala-list mailing list > vala-list@gnome.org > https://mail.gnome.org/mailman/listinfo/vala-list > -- www.debian.org - The Universal Operating System _______________________________________________ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list