Σύνδεση πρόσθετων ορισμάτων
If you use one signal handler to catch the same signal from several widgets, you might like that signal handler to receive some extra information. For instance, you might want to know which button was clicked. You can do this with sigc::bind(). Here's some code from the helloworld2 example.
m_button1.signal_clicked().connect( sigc::bind<Glib::ustring>( sigc::mem_fun(*this, &HelloWorld::on_button_clicked), "button 1") );
virtual void on_button_clicked(Glib::ustring data);
Η sigc::bind() δεν χρησιμοποιείται συνήθως, αλλά μπορείτε να την βρείτε χρήσιμη μερικές φορές. Αν είσαστε εξοικειωμένος με τον προγραμματισμό της GTK+, τότε θα έχετε προφανώς σημειώσει ότι αυτό είναι παρόμοιο με τα πρόσθετα ορίσματα gpointer data που όλα έχουν επανακλήσεις GTK+. Αυτό γενικά υπερχρησιμοποιείται στην GTK+ για το πέρασμα πληροφοριών που πρέπει να αποθηκευτούν ως μέλη δεδομένων σε ένα παράγωγο γραφικό συστατικό, αλλά μια παραγωγή γραφικού συστατικού είναι πολύ δύσκολη στη C. Έχουμε πολύ λιγότερη ανάγκη αυτής της επέμβασης στην gtkmm.