I noticed that if I set the window callback to onWindowClose_ and
provided a static member function onWindowClose_ that called the
[protected] member function onWindowClose, then doxygen generates
entries for both.
If I change this so that onWindowClose_ is a static function that
calls the [public] onWindowClose member function, doxygen does not
generate an entry for onWindowClose_. Great! Information hiding :-)
So then I tried to migrate the other callbacks to the same scheme.
I set the File/Quit menu item callback to onFileQuit_ and changed
onFileQuit_ from being a static member function to a static function,
and then I get the following message when I try to compile with g++:
error: overloaded function with no contextual type information
I can track this down to a spurious declaration in the header file:
extern void onFileQuit_(Fl_Menu_*, void*);
If I delete this line manually, I can compile and run.
See the works.fl and fails.fl examples below.
Cheers
Duncan
#-works.fl-------------------------------------
# data file for the Fltk User Interface Designer (fluid)
version 1.0109
header_name {.h}
code_name {.cxx}
decl {\#include <cstdio>} {}
Function {onWindowClose_(Fl_Double_Window* widget, void* data)} {private
return_type {static void}
} {
code {UserInterface* userInterface = (UserInterface*)data;
userInterface->onWindowClose(widget, data);} {}
}
comment {/// \\class UserInterface
/// \\brief Abstract base class} {in_source in_header
}
widget_class UserInterface {
user_data this
callback onWindowClose_ open
xywh {590 469 100 100} type Double
class Fl_Double_Window visible
} {
Fl_Menu_Bar m_menuBar {open
xywh {0 0 100 20}
} {
Submenu m_fileMenu {
label File open
xywh {0 0 63 21}
} {
MenuItem m_fileQuit {
label Quit
callback onFileQuit_
xywh {0 0 31 21}
}
}
}
Function {onWindowClose(Fl_Double_Window* widget, void* data)} {return_type
{virtual void}
} {
code {this->hide();} {}
}
Function {onFileQuit_(Fl_Menu_* widget)} {open return_type {static void}
} {
code {Fl_Menu_* menuBar = (Fl_Menu_*)widget;
UserInterface* userInterface = (UserInterface*)(menuBar->parent());
userInterface->onFileQuit(widget, userInterface);} {}
}
Function {onFileQuit(Fl_Menu_* widget, void* data)} {open selected protected
return_type {virtual void}
} {
code {printf("onFileQuit(%p, %p)\\n", widget, data);} {}
}
}
Function {} {open
} {
code {UserInterface* ui = new UserInterface(100, 100, "Ui");
ui->show(argc, argv);} {}
}
#-fails.fl-------------------------------------
# data file for the Fltk User Interface Designer (fluid)
version 1.0109
header_name {.h}
code_name {.cxx}
decl {\#include <cstdio>} {}
Function {onWindowClose_(Fl_Double_Window* widget, void* data)} {private
return_type {static void}
} {
code {UserInterface* userInterface = (UserInterface*)data;
userInterface->onWindowClose(widget, data);} {}
}
Function {onFileQuit_(Fl_Menu_* widget)} {open private return_type {static void}
} {
code {Fl_Menu_* menuBar = (Fl_Menu_*)widget;
UserInterface* userInterface = (UserInterface*)(menuBar->parent());
userInterface->onFileQuit(widget, userInterface);} {}
}
comment {/// \\class UserInterface
/// \\brief Abstract base class} {in_source in_header
}
widget_class UserInterface {
user_data this
callback onWindowClose_ open
xywh {590 469 100 100} type Double
class Fl_Double_Window visible
} {
Fl_Menu_Bar m_menuBar {open
xywh {0 0 100 20}
} {
Submenu m_fileMenu {
label File open
xywh {0 0 63 21}
} {
MenuItem m_fileQuit {
label Quit
callback onFileQuit_
xywh {0 0 31 21}
}
}
}
Function {onWindowClose(Fl_Double_Window* widget, void* data)} {open
return_type {virtual void}
} {
code {this->hide();} {}
}
Function {onFileQuit(Fl_Menu_* widget, void* data)} {open selected
return_type {virtual void}
} {
code {printf("onFileQuit(%p, %p)\\n", widget, data);} {}
}
}
Function {} {open
} {
code {UserInterface* ui = new UserInterface(100, 100, "Ui");
ui->show(argc, argv);} {}
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs