Re: Fwd: Emitting a signal - Help!!



WindowsXP
MinGW (latest)
GNU (latest)

Hello Milosz!
Ok, What I understand from your input is that the Tutorial has it wrong and that you have the right way, thus the Tutorial has to be changed.
Some time ago someone in this group suggested the idea of wiking (not sure of the spelling, so here is the link http://www.wikimedia.org/) the Tutorial, I think it would be a good idea, so that this Tutorial problems could be resolve by us, the users.

The new class looks like this
MyClass{
public:
     type_signal_end signal_quit(); // = [Frist Line] error: `type_signal_end' does not name a type == ERROR! ERROR!
private:
   ....
      //signal accessor
      typedef sigc::signal<my_enum::error_t> type_signal_end;
     

protected:
      type_signal_end m_signal_end1; //= [Second Line] error: `type_signal_end' does not name a type| == ERROR! ERROR!
}; //class

MyClass::type_signal_end MyClass::signal_quit() {
  return this->m_signal_end1;
}

The tester program has a catches the signal like this:

-Tester.cpp snip-
MyClass mc;
// Guess what 'Tester::quit' does? Yap, it ends the program!
mc.signal_quit().connect( sigc::mem_fun(*this, &Tester::quit) );

==========
Ok, I tried it, but no cigar,! Humm, maybe the wiking thing might not be a good idea. This suggestion could be the source of a lot of people's errors.
Back to the program, the error I get now is:

[Frist Line] error: `type_signal_end' does not name a type|
[Second Line] error: `type_signal_end' does not name a type|

Milosz suggestion is a sound suggestion, however it did not work!!
Can any body help?

Milosz Derezynski wrote:


---------- Forwarded message ----------
From: Milosz Derezynski <internalerror gmail com>
Date: Mon, Mar 1, 2010 at 6:50 PM
Subject: Re: Emitting a signal - Help!!
To: ArbolOne <arbolone gmail com>


That's because you declared it as private.

Take a look:

>   private:
>      ....
>         //signal accessor
>         typedef sigc::signal<my_enum::error_t> type_signal_end;
>         type_signal_end signal_quit();

Just declare it as public:

>   private:
>      ....
>         //signal accessor
>         typedef sigc::signal<my_enum::error_t> type_signal_end;
>   public:
>         type_signal_end signal_quit();


On Mon, Mar 1, 2010 at 3:31 AM, ArbolOne <arbolone gmail com> wrote:
WindowsXP
MinGW (latest)
GNU (latest)

Hello boys and girls.

MyClass{
public:
  ...
private:
   ....
      //signal accessor
      typedef sigc::signal<my_enum::error_t> type_signal_end;
      type_signal_end signal_quit();

protected:
      type_signal_end m_signal_end1;
}; //class

MyClass::type_signal_end MyClass::signal_quit() {
  return this->m_signal_end1;
}

I want my class to emit a signal, for this I have follow the Tutorial the best I can, as the example above shows. Later on, the class that uses my class calls has a listener that goes like this:
myclass.signal_quit().connect( sigc::mem_fun(*this, &Tester::the_method );

However, when I compile I get a strange error saying that 'type_signal_end signal_quit()' is private!!??
What have I done wrong and how can I fix this problem?

--
   ___   _____    _____   _____   _       _____   __   _   _____     /   | |  _  \  |  _  \ /  _  \ | |     /  _  \ |  \ | | | ____|  / /| | | |_| |  | |_| | | | | | | |     | | | | |   \| | | |__    / / | | |  _  /  |  _  { | | | | | |     | | | | | |\   | |  __|  / /  | | | | \ \  | |_| | | |_| | | |___  | |_| | | | \  | | |___  /_/   |_| |_|  \_\ |_____/ \_____/ |_____| \_____/ |_|  \_| |_____|

ArbolOne.org specializes in Custom Web Site Design, Web Site Re Design, Web Site Template Modifications, Web Site Maintenance, Integration of Payment Gateways (API's), Database Applications, Custom Applications and much more.
Happiness has many doors, and when one of them closes another opens, yet we spent so much time looking at the one that is shut that we don't see the one that just opened.


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]



--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]

_______________________________________________ gtkmm-list mailing list gtkmm-list gnome org http://mail.gnome.org/mailman/listinfo/gtkmm-list

-- 
     ___   _____    _____   _____   _       _____   __   _   _____  
    /   | |  _  \  |  _  \ /  _  \ | |     /  _  \ |  \ | | | ____| 
   / /| | | |_| |  | |_| | | | | | | |     | | | | |   \| | | |__   
  / / | | |  _  /  |  _  { | | | | | |     | | | | | |\   | |  __|  
 / /  | | | | \ \  | |_| | | |_| | | |___  | |_| | | | \  | | |___  
/_/   |_| |_|  \_\ |_____/ \_____/ |_____| \_____/ |_|  \_| |_____| 


ArbolOne.org specializes in Custom Web Site Design, Web Site Re Design, Web Site Template Modifications, Web Site Maintenance, Integration of Payment Gateways (API's), Database Applications, Custom Applications and much more. 

Happiness has many doors, and when one of them closes another opens, yet we spent so much time looking at the one that is shut that we don't see the one that just opened.


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