Re: GObject properties and g_value_set_string()

2019-02-06 Thread Joël Krähemann via gtk-app-devel-list
Hi again, Yes, g_value_set_string() does call g_strdup(). bests, Joël On Thu, Feb 7, 2019 at 5:20 AM Joël Krähemann wrote: > > Hi all, > > Currently, I do my properties like following: > > http://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/lib/ags_turtle.c?h=2.1.x#n175 >

GObject properties and g_value_set_string()

2019-02-06 Thread Joël Krähemann via gtk-app-devel-list
Hi all, Currently, I do my properties like following: http://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/lib/ags_turtle.c?h=2.1.x#n175 http://git.savannah.nongnu.org/cgit/gsequencer.git/tree/ags/lib/ags_turtle.c?h=2.1.x#n218 Is it ok to do g_strdup() and pass it to

Re: string interpolation

2018-12-21 Thread Joël Krähemann via gtk-app-devel-list
Hi, As you set a string property of a Gtk+ widget, the string is usually duplicated. However don't call any Gtk+ function outside the main loop, i.e. from a different thread. Bests, Joël On Fri, Dec 21, 2018 at 9:49 AM Lutz Lümken wrote: > > Hello, > > does GTK have some kind of string

Re: Working with embedded images with GResource, GdkPixbuf and GtkWidget

2018-11-11 Thread Joël Krähemann via gtk-app-devel-list
Hi, First you create a GdkPixbuf: https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-Image-Data-in-Memory.html#gdk-pixbuf-new-from-data then set the property of about dialog: https://developer.gnome.org/gtk2/stable/GtkAboutDialog.html#GtkAboutDialog--logo g_object_set(your_about_dialog,

Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Joël Krähemann via gtk-app-devel-list
Hi again, For sure you should probably use: g_signal_connect_after(your_text_buffer, "changed", G_CALLBACK(your_text_buffer_changed_callback), your_data); and YOUR_DATA(your_data) just casts to your pointer to a struct or object containing some information: struct _YourData{ gint

Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Joël Krähemann via gtk-app-devel-list
Hi, g_object_get(your_text_view, "buffer", _text_buffer, NULL); g_signal_connect(your_text_buffer, "changed", G_CALLBACK(your_text_buffer_changed_callback), your_data); void your_text_buffer_changed_callback(GtkTextBuffer *your_text_buffer, gpointer your_data) { gint line_count;

Fwd: question about gtk_dialog (gtk2)

2018-06-22 Thread Joël Krähemann via gtk-app-devel-list
-- Forwarded message - From: Joël Krähemann Date: Thu, Jun 21, 2018 at 1:31 PM Subject: Re: question about gtk_dialog (gtk2) To: Wojciech Puchar Hi, Alternatively, you could inherit GTK_TYPE_DIALOG and do your very own object. During ::map() and ::realize() you are able to

Fwd: question about gtk_dialog (gtk2)

2018-06-22 Thread Joël Krähemann via gtk-app-devel-list
-- Forwarded message - From: Joël Krähemann Date: Thu, Jun 21, 2018 at 1:11 PM Subject: Re: question about gtk_dialog (gtk2) To: Wojciech Puchar Hi Wojciech, What about: dialog = g_object_new(GTK_TYPE_DIALOG, "window-position",