diff options
Diffstat (limited to 'body/c_fl_text_editor.cpp')
-rw-r--r-- | body/c_fl_text_editor.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/body/c_fl_text_editor.cpp b/body/c_fl_text_editor.cpp index 6138cb2..0efea0b 100644 --- a/body/c_fl_text_editor.cpp +++ b/body/c_fl_text_editor.cpp @@ -6,6 +6,7 @@ #include <FL/Fl_Text_Editor.H> #include "c_fl_text_editor.h" +#include "c_fl.h" @@ -61,7 +62,11 @@ TEXTEDITOR new_fl_text_editor(int x, int y, int w, int h, char* label) { } void free_fl_text_editor(TEXTEDITOR te) { - delete static_cast<My_Text_Editor*>(te); + if (fl_inside_callback) { + fl_delete_widget(te); + } else { + delete static_cast<My_Text_Editor*>(te); + } } @@ -355,9 +360,6 @@ void fl_text_editor_set_insert_mode(TEXTEDITOR te, int i) { static_cast<Fl_Text_Editor*>(te)->insert_mode(i); } - - - int fl_text_editor_get_tab_nav(TEXTEDITOR te) { #if FLTK_ABI_VERSION >= 10304 return static_cast<Fl_Text_Editor*>(te)->tab_nav(); |