Skip to content

Commit

Permalink
update fltk
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Nov 7, 2023
1 parent 0a963af commit 85f6655
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/cfl_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ typedef void (*custom_draw_callback)(Fl_Widget *, void *);
void widget##_set_deletion_callback( \
widget *self, void (*)(Fl_Widget *, void *), void *data); \
widget *widget##_from_dyn_ptr(Fl_Widget *ptr); \
widget *widget##_from_derived_dyn_ptr(Fl_Widget *ptr); \
void widget##_super_draw(Fl_Widget *ptr, int flag); \
void widget##_super_draw_first(Fl_Widget *ptr, int flag);

Expand Down Expand Up @@ -406,6 +407,9 @@ typedef void (*custom_draw_callback)(Fl_Widget *, void *);
widget *widget##_from_dyn_ptr(Fl_Widget *ptr) { \
return widget##_Derived::from_dyn_ptr(ptr); \
} \
widget *widget##_from_derived_dyn_ptr(Fl_Widget *ptr) { \
return widget##_Derived::from_derived_dyn_ptr(ptr); \
} \
void widget##_super_draw(Fl_Widget *self, int flag) { \
((widget##_Derived *)self)->super_draw = flag; \
} \
Expand Down
4 changes: 4 additions & 0 deletions include/cfl_widget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ struct Widget_Derived : public T {
return dynamic_cast<T *>(ptr);
}

static Widget_Derived *from_derived_dyn_ptr(Fl_Widget *ptr) {
return dynamic_cast<Widget_Derived *>(ptr);
}

void widget_resize(int x, int y, int w, int h) {
Fl_Widget::resize(x, y, w, h);
this->redraw();
Expand Down

0 comments on commit 85f6655

Please sign in to comment.