summaryrefslogtreecommitdiff
path: root/fluid/Fl_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2024-07-27 20:22:50 +0200
committerMatthias Melcher <github@matthiasm.com>2024-07-27 20:22:50 +0200
commitd265009b66cbc69ca6edf502dc23199a01d62220 (patch)
tree85afd145bfd05c152371ea00388bf71f745ab1fe /fluid/Fl_Type.cxx
parent8cffbd694106a2371d297caa008f2290185fed2f (diff)
FLUID: fixes crash bug in Fl_Sys_Men_Bar inside a Class. #977
Diffstat (limited to 'fluid/Fl_Type.cxx')
-rw-r--r--fluid/Fl_Type.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx
index 1654bfd20..a9e2bcb4b 100644
--- a/fluid/Fl_Type.cxx
+++ b/fluid/Fl_Type.cxx
@@ -1006,6 +1006,19 @@ const char *Fl_Type::callback_name(Fd_Code_Writer& f) {
return f.unique_id(this, "cb", name(), label());
}
+/**
+ \brief Return the class name if this type is inside a Class or Widget Class.
+
+ This methods traverses up the hirarchy to find out if this Type is located
+ inside a Class or Widget Class. It then return the name of that class. If
+ need_nest is set, class_name searches all the way up the tree and concatenates
+ the names of classes within classes, separated by a "::".
+
+ \param need_nest if clear, search up one level to the first enclosing class.
+ If set, recurse all the way up to the top node.
+ \return the name of the enclosing class, or names of the enclosing classes
+ in a static buffe (don't call free), or NULL if this Type is not inside a class
+ */
const char* Fl_Type::class_name(const int need_nest) const {
Fl_Type* p = parent;
while (p) {