summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-05-28 10:07:41 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:45 -0400
commit7c6cfd9fa00293aed1d4092481c1dbed8aabc33d (patch)
treeed823a40a52433029d08df6a8c2fa2c758fe7e4f
parent518fd81e6c9339aed65e19987ee15923f3baf634 (diff)
more sensible API for Pane::set_child_minsize
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/pane.h2
-rw-r--r--libs/gtkmm2ext/pane.cc14
2 files changed, 6 insertions, 10 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/pane.h b/libs/gtkmm2ext/gtkmm2ext/pane.h
index 4a18a49d7c..6c67c82196 100644
--- a/libs/gtkmm2ext/gtkmm2ext/pane.h
+++ b/libs/gtkmm2ext/gtkmm2ext/pane.h
@@ -57,7 +57,7 @@ class LIBGTKMM2EXT_API Pane : public Gtk::Container
Pane (bool horizontal);
void set_divider (std::vector<float>::size_type divider, float fract);
float get_divider (std::vector<float>::size_type divider = 0);
- void set_child_minsize (Children::size_type n, int32_t);
+ void set_child_minsize (Gtk::Widget const &, int32_t);
GType child_type_vfunc() const;
void set_drag_cursor (Gdk::Cursor);
diff --git a/libs/gtkmm2ext/pane.cc b/libs/gtkmm2ext/pane.cc
index fa24a7d4f7..c539403b4d 100644
--- a/libs/gtkmm2ext/pane.cc
+++ b/libs/gtkmm2ext/pane.cc
@@ -45,18 +45,14 @@ Pane::Pane (bool h)
}
void
-Pane::set_child_minsize (Children::size_type n, int32_t minsize)
+Pane::set_child_minsize (Gtk::Widget const& w, int32_t minsize)
{
- Children::iterator c = children.begin();
-
- while (n--) {
- if (c == children.end()) {
- return;
+ for (Children::iterator c = children.begin(); c != children.end(); ++c) {
+ if (c->w == &w) {
+ c->minsize = minsize;
+ break;
}
- ++c;
}
-
- c->minsize = minsize;
}
void