19/01/08 13:57:27.89 apChm6zE.net
ヘッダーよりググッてリファレンスを見るべき、読めないなら翻訳にぶちこむ
URLリンク(developer.gnome.org)
A window title is set using gtk_window_set_title(). This function takes a GtkWindow* pointer and a string as input.
As our window pointer is a GtkWidget pointer, we need to cast it to GtkWindow*.
But instead of casting window via (GtkWindow*), window can be cast using the macro GTK_WINDOW().
GTK_WINDOW() will check if the pointer is an instance of the GtkWindow class, before casting, and emit a warning if the check fails.
More information about this convention can be found here.
URLリンク(developer.gnome.org)
#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type))
Checks that instance is an instance of the type identified by g_type and issues a warning if this is not the case. Returns instance casted to a pointer to c_type .
No warning will be issued if instance is NULL, and NULL will be returned.
This macro should only be used in type implementations.