Re: GTK2 with c++, without gtkmm [EOT]



Hello!

<PROBLEM#1>
Unlike C, C++ wont let you assign OR'd bit values to an enum, you have 
to do a cast, like so:
<<<<<<>>>>>>>>> (GtkAttachOptions)GTK_FILL|GTK_SHRINK,

As the matter of fact, I already tried casting, but THE SAME compile 
error still ocurred. But I just tried to look at this again... and
again ... - and it turned out, my problem lied in operator 
precedence!!!

The very correct version is:
=== (GtkAttachOptions) (GTK_FILL|GTK_SHRINK) ===
- because your suggestion (and my own attempts)
was to cast GTK_FILL to GtkAtachOptions and
*LATER* make bitwise OR with a GtkAttachOptions
value.

However suggestions from group made me have another look at 
casting - so sincere thanks!
</PROBLEM#1>

<PROBLEM#2>
[,,,]   g_signal_connect (G_OBJECT (button), "clicked",
                    G_CALLBACK (callback), (gpointer) this->foo2);
You are trying to assign a value to a temporary value for use outside 
the function.

In this case - I don't have words for any explanation :-))
Of course I did NOT take the address - really don't know
why; I suspect I thought sth like: "if G_CALLBACK takes
only idenyfier (i.e. function address) , next parameter of course
does the same (grrr..... stupid me)".

What's the point? I *really, really* should sleep more :-))

</PROBLEM#2>

Thank for your and all answers - You were *very* helpful !!!

Waldek Maleska


----------------------------------------------------------------------
Reprezentacja Polski w Skokach Narciarskich: OFICJALNY SERWIS
http://link.interia.pl/f16a6 





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