+ double limit = DBL_MAX;
+
+ if (label_on_left ()) {
+ limit = _left_label_limit;
+ } else {
+ limit = _right_label_limit;
+ }
+
+ /* Work out how wide the name can be */
+ int name_width = min ((double) pixel_width (_name, name_font) + 2, limit);
+ if (name_width == 0) {
+ name_width = 1;
+ }
+
+ if (label_on_left ()) {
+ name_pixbuf->property_x() = -name_width;
+ }
+
+ name_pixbuf->property_pixbuf() = pixbuf_from_string (_name, name_font, name_width, name_height, Gdk::Color ("#000000"));
+
+ if (label_on_left ()) {
+ _name_background->property_x1() = name_pixbuf->property_x() - 2;
+ _name_background->property_x2() = name_pixbuf->property_x() + name_width + _shift;
+ } else {
+ _name_background->property_x1() = name_pixbuf->property_x() - _label_offset + 2;
+ _name_background->property_x2() = name_pixbuf->property_x() + name_width;