[gtkmm] signal handlers vs. virtual functions
- From: Davide Rossetti <rossetti apemaia roma1 infn it>
- To: gtk mailing list <gtk-list redhat com>
- Subject: [gtkmm] signal handlers vs. virtual functions
- Date: Thu, 17 Sep 1998 15:39:42 +0200 (MET DST)
hi gtk-- users,
I have a mothodological question:
when is "good" to override X_impl() virtual functions in gtk-- widgets ?
as I understand it:
1) for main windows C++ classes (as dialog, toplevel) use
connect_to_method() to grab signals from plain gtk-- widgets that they
`contain' as member objects
2) for personalised widget classes, subclassed from stock gtk-- widget
classes, there are two options available:
2.1) use connect_to_method(X, this, handle_X_method);
2.2) override X_impl().
(2.2) can give problems: either it is a do nothing function [is it
true?] or there is 'meat' inside and you have to call the
Super::X_impl() right inside your X_impl() [and you have to
remember/know when to call it before or after your processing]
What are your suggestions ?
I went into this thought writing a simple gtk-- program taking
hello.cc as a guide.
+------------------------------------------------------------------+
|Rossetti Davide INFN - Sezione Roma I - gruppo V, prog. APEmille|
| web : http://apemaia.roma1.infn.it/~rossetti |
| """"" E-mail : davide.rossetti@roma1.infn.it |
| |o o| phone : (+39)-6-49914412 |
|--o00O-O00o-- fax : (+39)-6-4957697 |
| address: Dipartimento di Fisica (V.E.) |
| Universita' di Roma "La Sapienza" |
| P.le Aldo Moro,5 I - 00185 Roma - Italy|
| pgp pub. key: finger rossetti@apemaia.roma1.infn.it |
| |
|"Most people think about twice a year. I got famous by thinking |
| once a week." - George B. Shaw (see Appendix A) |
+------------------------------------------------------------------+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]