Question about type casting.

I've a quick question here. When we call the

gtk_menu_bar_append (menu, child)

Why we had to cast on menu to make it GTK_MENU_BAR but we don't cast the child which is a GTK_MENU_ITEM?

Here's what i meant:

GtkWidget *menu_bar, *file_menu_item, ....


gtk_menu_bar_append(GTK_MENU_BAR(menu_bar), file_menu_item);

Why we cast for the first argument of this function but not the second one?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]