[gtkmm] Need your advice for glademm code



Good morning Murray,

motivated by your advice I changed the connect statements in the autogenerated file to use virtual functions instead of the static_cast<>,include and friend magic.

  Original statement:

button_close->clicked.connect(SigC::slot(static_cast<class Artikeleingabe*>(this), &Artikeleingabe::on_button_close_clicked));

  new variant:

button_close->clicked.connect(SigC::slot(this, &Artikeleingabe_glade::on_button_close_clicked));

  with

class Artikeleingabe_glade
{ ...
   virtual void on_button_close_clicked() = 0;
};

  which is overloaded in Artikeleingabe.

So far it works very well. But once you connect to a signal of a custom widget, glade-- can not guess the signature of the virtual function to create. Another downside is that you cannot mark any callbacks as const.

Do you have any ideas on how to solve the problem without giving up the benefits of using virtual functions? My first idea was to fall back to the old method for custom widgets.

   Christof




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