Re: Is this a cast?



On Fri, 11 Oct 2013, Patrick wrote:

Apologies if this is a duplicate post. I am having some email trouble.....

This is the wrong list (it's about the development of GTK itself); you want gtk-app-devel (which is about working on GTK applications).

That said,

g_signal_connect_swapped( G_OBJECT ( button1 ) ... continues.. on......

button1 is type GtkWidget, is it being cast to type G_OBJECT ?

Sort of, but with type checking. It's not a straight cast; it's a macro defined in glib-2.0/gobject.h.

I am used to seeing casts like:

number1 = (int) another_num but I suppose the parenthesis can actually go around the type or the variable, correct?

No. In a regular C cast you can't put the parentheses around the variable name.

Allin Cottrell




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