Thread: How to dynamically change GTK window title?

  1. #1
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43

    How to dynamically change GTK window title?

    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:

    Code:
    GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `GtkWindow'
    
    Gtk-CRITICAL **: IA__gtk_window_set_title: assertion `GTK_IS_WINDOW (window)' failed

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    have you tried the GTK Reference?

  3. #3
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43
    Yeah,

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

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    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.

  5. #5
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43

    Ok

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

  6. #6
    Registered User Ravi Raj's Avatar
    Join Date
    May 2012
    Location
    INDIA
    Posts
    43
    Thanks Elkvis,

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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Window without title bar
    By maxorator in forum Windows Programming
    Replies: 1
    Last Post: 10-16-2005, 12:26 AM
  2. Title and Icon On Window
    By matth in forum C++ Programming
    Replies: 0
    Last Post: 03-21-2005, 03:53 PM
  3. Change Title in a MFC SDI
    By hick.hack in forum Windows Programming
    Replies: 1
    Last Post: 12-15-2003, 04:15 PM
  4. How to give a window a title.
    By sean in forum Windows Programming
    Replies: 10
    Last Post: 11-04-2001, 10:54 AM
  5. Change Title
    By Witch_King in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 09-01-2001, 12:57 PM

Tags for this Thread