PDA

View Full Version : How to dynamically change GTK window title?



Ravi Raj
05-15-2012, 07:10 AM
Hello friends,

I am a newbie to C programming and GTK.

I want to change the tile of the the GTK top level window from the click of a button.

A form with three buttons each sets different title to the parent window, how to do this.

I had written a bad code with these errors:


GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GtkWindow'

Gtk-CRITICAL **: IA__gtk_window_set_title: assertion `GTK_IS_WINDOW (window)' failed

Elkvis
05-15-2012, 07:17 AM
have you tried the GTK Reference (http://developer.gnome.org/gtk/2.24/GtkWindow.html#gtk-window-set-title)?

Ravi Raj
05-15-2012, 07:19 AM
Yeah,

I had referenced the link you provided. But, it doesn't provide much detail.
Please help.

Elkvis
05-15-2012, 07:52 AM
it looks to me like you are passing a null pointer to gtk_window_set_title(). check to be sure that you have a valid pointer to the window when trying to do this.

Ravi Raj
05-15-2012, 09:27 AM
Is there anyone who can give me solution with proper example. Coz, I couldn't get it to work till now.

Ravi Raj
05-15-2012, 09:53 AM
Thanks Elkvis,

Problem solved. there was really a NULL pointer referencing the gtk_window_set_title().