Hello,
I want to change titlie of main window of my C/gtk+ application. I have code:
void update_title(const char *filename, MainWin* mw )
{
GtkButton* btn = gtk_button_new();
static int wid, hei;
static char fname[50];
char buf[100];
if(filename != NULL)
{
strncpy(fname, filename, 49);
wid = gdk_pixbuf_get_width( gtk_image_view_get_pixbuf (GTK_IMAGE_VIEW(aview)) );
hei = gdk_pixbuf_get_height( gtk_image_view_get_pixbuf ( GTK_IMAGE_VIEW(aview)) );
fname[49] = '\0';
}
snprintf(buf, 100, "%s (%dx%d) %d%%", fname, wid, hei, (int)(mw->scale * 100));
gtk_window_set_title(mw, buf);
}
When i try to call this function i see error: Gtk-CRITICAL **: gtk_window_set_title: assertion `GTK_IS_WINDOW (window)' failed
What's wrong?
Thank you.