Yes, that's so. The number of param passing depends on detailed signal which
is invoked. For instance, "clicked" is a signal that invokes

void user_function (GtkButton *button,  gpointer   user_data)   : Run
First / Action

so my func should be

void callback_do_test (GtkButton *button,  gpointer data )

instead of

void callback_do_test
(GtkWidget* widget,  GtkAction * action, gpointer data )


Type-casting is no problem but redundant param will lead to application
accessing arbitrary data as you said.

That's the reason why the app ran so unstably.

Hey, don't know why it ran well on Maemo 3.x. Is it a BUG? Don't know
if 3.xis open now.

Thanks a lot one more time, Markku Vire!

Have a nice day!

On Mon, Feb 25, 2008 at 6:31 PM, Jakov <[EMAIL PROTECTED]> wrote:

>
> Oh my God! I didn't realize that for a long time! This morning after such
> a stupid prob, I removed maemo 4.0 and installed Maemo 3.2. Not tested
> yet, but I think it should have the same params counts as you say. I'll tell
> you the result soon. Just a quick msg now to say thank you! Thanks so much,
> Markku Vire!
>
>
>
>
> On Mon, Feb 25, 2008 at 6:00 PM, Markku Vire <[EMAIL PROTECTED]>
> wrote:
>
> >
> > Hi,
> >
> > The problem behind "changing parameters" is that you are attaching wrong
> > type of singal handler to signal (i.e. the number/type of parameters
> > don't match).
> >
> > I didn't actually try your code, but at least you cannot connect
> > "callback_do_test" (3 parameters) to "clicked" signal (2 parameters).
> > This will lead to you application accessing arbitrary data.
> >
> > Hope this helps,
> >
> > -Markku-
> >
> > Jakov wrote:
> > > Hi,
> > >
> > > I have a very simple app running on Maemo 4.0 with a textbox and a
> > button.
> > > As I click on the button, a callback function is invoked to show the
> > content
> > > of the textbox. I don't know why the data pointer which is passed to
> > > callback function is sometimes NULL:
> > > - if I click on the textbox (a virtual keyboard shown below) and then
> > click
> > > on the button, the callback function failed due to assertion of data
> > pointer
> > > - if I just click the button (don't focus on the textbox), the data
> > pointer
> > > is not NULL, but the child of it is NULL.
> > >
> > > I'm so confused. It didn't happen on Maemo 3.2 before.
> > >
> > > Here's the code of 4 files (interface.*, callbacks.*) in my project
> > /src/ui,
> > > I follow the structure of maemopad-2.1
> > > http://paste.org/index.php?id=2098
> > >
> > > If you're interested in solving this problem, please help me out.
> > Thanks
> > > very much!
> > >
> > > Best regards,
> > > Jakov
> > >
> > >
> > >
> > >
> > ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > maemo-developers mailing list
> > > maemo-developers@maemo.org
> > > https://lists.maemo.org/mailman/listinfo/maemo-developers
> >
> >
>
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to