Re: [gtk-list] Re: Question about gtk-- signals..



On 19 Apr 1998, Tero Pulkkinen wrote:

> jfp@squinky.org writes:
> >           /********What is wrong with this line???*************/
> >           connect(radiob->toggled,this, &RadioButtonBox::DoButtonBoxChange
> 
> radiob->toggled is a signal that takes no arguments and expects no return
> type from the destination.
> 
> > RadioButtonBox::DoButtonBoxChange( Gtk_ToggleButton* toggle )
> > {
> >   if (toggle->get_state())
> >     {
> >       sigBoxChanged( buttonSpec[1].val);
> >     }
> > }                                                                                     
> This one however takes one argument.
> 
> The sollution is either to remove the extra argument from the method, or
> give  one extra argument for the connect() call.
> 
> So, either do this:
>  connect(radiob->toggled,this, &RadioButtonBox::DoButtonBoxChange, mytogglebutton);
> 

I tried this already actually..Here's the exact syntax I used:

/********What is wrong with this line???***********/
connect(radiob->toggled,this, &RadioButtonBox::DoButtonBoxChange,radiob );

And here's the method that receives the signal (basically unchanged)...

RadioButtonBox::DoButtonBoxChange(Gtk_ToggleButton *b)
{}

And the compiler spits out this lovely error message:

RadioButtonBox.cc: In method `RadioButtonBox::RadioButtonBox(char *,
struct ButtonBoxSpec *, int)':
RadioButtonBox.cc:28: conversion from
`Signal_proxy0<void,Gtk_ToggleButton>' to non-scalar type `Signal0'
requested
/usr/local/include/gtk--sig.h:886: in passing argument 1 of
`connect(Signal0 &, void (*)())'


hmmm? This error message looks a little more decipherable.. It seems to
say that I'm trying to cast this thing into a Signal that sends no
arguments to the attached call, right?  Well does it send a
Gtk_ToggleButton to the attached call? Hmm.. I'm stumped...


-----------------------------------------------------------------------
 Justin Sher         |  "No appeal to any historical or empirical    
 Programmer/Analyst  |   consideration can discover any fault in the
 NDST Communications |   proposition that men aim purposefully at  
 justin@ndst.com     |	 certain chosen ends." -L. Von Mises		   






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