Skip to content

Commit

Permalink
Add Flex::Layout method
Browse files Browse the repository at this point in the history
For #93
  • Loading branch information
pwiecz committed Jul 9, 2023
1 parent 3291a88 commit 9022f7d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flex.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ int go_fltk_Flex_margin(Fl_Flex* flex) { return flex->margin(); }

void go_fltk_Flex_set_margin(Fl_Flex* flex, int margin, int gap) { flex->margin(margin, gap); }

void go_fltk_Flex_layout(Fl_Flex* flex) { flex->layout(); }

const unsigned char go_FL_FLEX_COLUMN = Fl_Flex::COLUMN;
const unsigned char go_FL_FLEX_ROW = Fl_Flex::ROW;
5 changes: 5 additions & 0 deletions flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ func (f *Flex) SetMargin(margin int, gap ...int) {
}
C.go_fltk_Flex_set_margin((*C.Fl_Flex)(f.ptr()), C.int(margin), C.int(g))
}

// Layout calculates the layout of the widget and redraws it.
func (f *Flex) Layout() {
C.go_fltk_Flex_layout((*C.Fl_Flex)(f.ptr()))
}
2 changes: 2 additions & 0 deletions flex.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ extern "C" {

extern void go_fltk_Flex_set_margin(Fl_Flex* flex, int margin, int gap);

extern void go_fltk_Flex_layout(Fl_Flex *flex);

extern const unsigned char go_FL_FLEX_COLUMN;
extern const unsigned char go_FL_FLEX_ROW;

Expand Down

0 comments on commit 9022f7d

Please sign in to comment.