Fw: Re: gtk+ 2.0 marshaller problems with passing non gpointer variables?



Sorry, pressed the wrong reply button...


---------- Forwarded message -----------
Date: Thu, 4 Oct 2001 01:04:34 +0200
From: Melvin Hadasht <melvin hadasht free fr>
To: safemode <safemode speakeasy net>
Subject: Re: gtk+ 2.0 marshaller problems with passing non gpointer
variables?

On Wed, 3 Oct 2001 18:52:26 -0400 safemode <safemode speakeasy net> wrote:

On Wednesday 03 October 2001 11:21, Melvin Hadasht wrote:
Hi,

The definition of you callback function has the wrong arguments :

in this case, for the signal "clicked" and for the button the callback
function should be declared as (search in the archive for a mail which
tells you exactly how to find those arguments) :

void create_file_select(GtkWidget *w, gpointer *chosen1)

I think the first argument is always the widget from which the
signal/event
was sent (in this case : 'button').

Hth

See the problem with that is i'm sending a structure.  gpointer does not 
allow me to access any of the elements in the structure, giving an error
such 
as "cannot access element because chosen1 is of non aggregate type void"


You have the choice (just a cast pb) : 

1. void create_file_select(GtkWidget *w, gpointer *chosen1) {
        info *thechosen = (info *) chosen1;
        ....}

or directly :

2. void create_file_select(GtkWidget *w, info *choser1) {
        ....
        chosen1->selected...
        }

I personnaly use 2. but I am not a professional :)




-- 
Melvin Hadasht

-------- End Forwarded message ---------


-- 
Melvin Hadasht




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