Skip to content

Commit

Permalink
fix tree open_icon and close_icon
Browse files Browse the repository at this point in the history
  • Loading branch information
MoAlyousef committed Jul 9, 2024
1 parent 4d16c7f commit d027944
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion fltk
Submodule fltk updated 1 files
+1 −1 src/Fl_Tree_Item.cxx
4 changes: 2 additions & 2 deletions src/cfl_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ int Fl_Anim_GIF_Image_playing(const Fl_Anim_GIF_Image *self) {
IMAGE_DEFINE(Fl_Pixmap)

Fl_Pixmap *Fl_Pixmap_new(const char *const *D) {
LOCK(auto ret = new Fl_Pixmap(D));
return ret;
LOCK(auto temp = new Fl_Pixmap(D); auto ret = temp->copy(temp->w(), temp->h()); delete temp);
return (Fl_Pixmap *)ret;
}

IMAGE_DEFINE(Fl_XPM_Image)
Expand Down
8 changes: 2 additions & 6 deletions src/cfl_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,7 @@ void *Fl_Tree_openicon(const Fl_Tree *self) {
}

void Fl_Tree_set_openicon(Fl_Tree *self, void *val) {
LOCK(auto old = self->openicon(); if (!val) self->openicon(nullptr);
else self->openicon(((Fl_Image *)val)->copy());
)
LOCK(self->openicon(((Fl_Image *)val)->copy()));
}

void *Fl_Tree_closeicon(const Fl_Tree *self) {
Expand All @@ -430,9 +428,7 @@ void *Fl_Tree_closeicon(const Fl_Tree *self) {
}

void Fl_Tree_set_closeicon(Fl_Tree *self, void *val) {
LOCK(auto old = self->closeicon(); if (!val) self->closeicon(nullptr);
else self->closeicon(((Fl_Image *)val)->copy());
)
LOCK(self->closeicon(((Fl_Image *)val)->copy()));
}

int Fl_Tree_showcollapse(const Fl_Tree *self) {
Expand Down

0 comments on commit d027944

Please sign in to comment.