+void PositionLabel::update_position (float floor, Direction direction)
+{
+ switch (direction)
+ {
+ case UP:
+ direction_img_.set(Gtk::Stock::GO_UP, Gtk::ICON_SIZE_BUTTON);
+ break;
+ case DOWN:
+ direction_img_.set(Gtk::Stock::GO_DOWN, Gtk::ICON_SIZE_BUTTON);
+ break;
+ case IDLE:
+ direction_img_.set(Gtk::Stock::YES, Gtk::ICON_SIZE_BUTTON);
+ break;
+ default:
+ std::cout << "Bad direction in PositionLabel->update_position(" << floor
+ << ", " << direction << ")" << std::endl;
+ break;
+ }
+
+ std::ostringstream str;
+
+ // Generate the text
+ str << std::setiosflags (std::ios_base::showpoint | std::ios_base::fixed)
+ << std::setprecision(1) << floor;
+
+ label_.set_text (str.str());
+}
+
+