syntax help : m_button.signal_clicked().connect(sigc:...

This is a discussion on syntax help : m_button.signal_clicked().connect(sigc:... within the C++ Programming forums, part of the General Programming Boards category; Hi. Will someone educate me on the correct terms/words for the following syntax so I can google for more info. ...

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    syntax help : m_button.signal_clicked().connect(sigc:...

    Hi.

    Will someone educate me on the correct terms/words for the following syntax so I can google for more info.

    Code:
    ().connect(
    in:

    Code:
    m_button.signal_clicked().connect(sigc::mem_fun(*this,&HelloWorld::on_button_clicked));
    I understand what this does, establish the connection. But a reference to a guide with some examples and explanations on the syntax would be great.

    thx

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    3
    Code:
    m_button.signal_clicked()
    This means: call member function signal_clicked() of class m_button.

    signal_clicked() returns an object of a class with a memberfunction named connect(). Is that correct? If I'm right about that, then is there a name for this syntax? I would like to read more about this syntax.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,886
    Quote Originally Posted by Mannic
    This means: call member function signal_clicked() of class m_button.
    Almost, except that m_button is an object, not a class.

    Quote Originally Posted by Mannic
    signal_clicked() returns an object of a class with a memberfunction named connect(). Is that correct?
    Yes.

    Quote Originally Posted by Mannic
    If I'm right about that, then is there a name for this syntax?
    I call it function (or function call) chaining.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    3
    Thanks, exactly what I needed.

    I found an example here. Easy to understand, and just as expected.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 06:33 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 09:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21