Re: gtk 1.1.14 - callback for button clicked changed?



On Sat, Jan 30, 1999 at 11:30:14PM +0100, Rasca Gmelch wrote:
> i think you are wrong, first the theory:
> 
>  - in the 'prog' structure it is also passed a file name of an application
>    which will be started on button-click. until now it works fine.
>    if there would be an argument before the 'prog' argument a segmention
>    fault would be very likely (strings are more dangerous than just an
>    integer, isn't it?)
> 
> and then the praxis:
> 
>  - i've changed my code as you said, but now i get a segmention fault
>    while accessing the strings in the 'prog' structure.. so i think
>    the gpointer from the gtk_signal_connect() is as i had it first the
>    SECOND argument in the callback!
> 
>  - my question still lives: is there a third argument or not? is that
>    the event?
> 
> the function is connected via:
> 
> gtk_signal_connect (GTK_OBJECT(button), "clicked",
>         GTK_SIGNAL_FUNC(button_clicked), (void *) prog);

there is no event pointer passed ... you have to get it ... (I can't
remember the call ... basically to get the most recent event)

so the prototype should be just (widget,prog)

George

-- 
------------------------------------------------------------------------------
George Lebl <jirka@5z.com> http://www.5z.com/jirka/
------------------------------------------------------------------------------
  The following implements RSA in perl and is illegal to export from the US:

          #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
          $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
          lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)



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