Add or remove a scrollbar from this listbox based on height and available options.

        :param width: Width of the Listbox
        :param height: Height of the Listbox.
        :param dy: Vertical offset from top of widget.
767333
def _add_or_remove_scrollbar(self, width, height, dy):
        
        if self._scroll_bar is None and len(self._options) > height:
            self._scroll_bar = _ScrollBar(
                self._frame.canvas, self._frame.palette, self._x + width - 1, self._y + dy,
                height, self._get_pos, self._set_pos)
        elif self._scroll_bar is not None and len(self._options) <= height:
            self._scroll_bar = None
617763
public void setSize(int width, int height) {
        final float r = width * 0.75f / SIN;
        final float y = COS * r;
        final float h = r - y;
        final float or = height * 0.75f / SIN;
        final float oy = COS * or;
        final float oh = or - oy;

        mRadius = r;
        mBaseGlowScale = h > 0 ? Math.min(oh / h, 1.f) : 1.f;

        mBounds.set(mBounds.left, mBounds.top, width, (int) Math.min(height, h));
    }
835752
function() {
        var dimensionModel, height;

        if (this.$scrollBorder) {
            dimensionModel = this.dimensionModel;
            height = dimensionModel.get('bodyHeight') - dimensionModel.getScrollXHeight();
            this.$scrollBorder.height(height);
        }
    }
872612
public void setCanvasWidthHeight(int width, int height) {
        hudWidth = width;
        hudHeight = height;
        HUD = Bitmap.createBitmap(width, height, Config.ARGB_8888);
        canvas = new Canvas(HUD);
        texture = null;
    }
1188294
def on_resize(self, width, height):
        
        width, height = self._update_perspective(width, height)
        self.scene.camera.resolution = (width, height)
        self.view['ball'].resize(self.scene.camera.resolution)
        self.scene.camera.transform = self.view['ball'].pose
1162951
function(width, height) {
    if (width === this._width && height === this._height) {
      return;
    }
    this._resize = true;
    this._width = width;
    this._height = height;
  }
1284913
function(width, height) {
      this.getPos(true);
      this.translateOffsetX = this.translateOffsetY = 0;
      this.scaleOffsetX = this.scaleOffsetY = 1;
      for(var i=0, l=this.canvases.length; i<l; i++) {
        this.canvases[i].resize(width, height);
      }
      var style = this.element.style;
      style.width = width + 'px';
      style.height = height + 'px';
      if(this.labelContainer)
        this.labelContainer.style.width = width + 'px';
    }
106861
public void setScrollableArea (int x, int y, int width, int height)
    {
        Rectangle vb = _panel.getViewBounds();
        int hmax = x + width, vmax = y + height, value;

        if (width > vb.width) {
            value = MathUtil.bound(x, _hrange.getValue(), hmax - vb.width);
            _hrange.setRangeProperties(value, vb.width, x, hmax, false);
        } else {
            // Let's center it and lock it down.
            int newx = x - (vb.width - width)/2;
            _hrange.setRangeProperties(newx, 0, newx, newx, false);
        }
        if (height > vb.height) {
            value = MathUtil.bound(y, _vrange.getValue(), vmax - vb.height);
            _vrange.setRangeProperties(value, vb.height, y, vmax, false);
        } else {
            // Let's center it and lock it down.
            int newy = y - (vb.height - height)/2;
            _vrange.setRangeProperties(newy, 0, newy, newy, false);
        }
    }
303406
def _resize(self, width, height):
        '''
        
        '''
        self._dirty_size = width, height
        self.reset_canvas(width, height)
        self.draw()
        self._dirty_draw = True
790098
public void setHeight(int height) {

        m_defaultHeight = height;
        m_scrollPanel.setHeight(m_defaultHeight + "px");
        m_scrollPanel.setDefaultHeight(m_defaultHeight);
        m_scrollPanel.onResizeDescendant();
    }
803273
void selectBlockSize( int width , int height , int requestedBlockWidth) {

		if( height < requestedBlockWidth ) {
			blockHeight = height;
		} else {
			int rows = height/requestedBlockWidth;
			blockHeight = height/rows;
		}

		if( width < requestedBlockWidth ) {
			blockWidth = width;
		} else {
			int cols = width/requestedBlockWidth;
			blockWidth = width/cols;
		}
	}
962541
def addWidget(self, widget, align=Qt.AlignLeft, before=None):
        
        # self.uiToolbarLAYOUT points to a deleted C/C++ object in PySide...
        layout = self.findChild(QHBoxLayout, 'uiToolbarLAYOUT')
        
        if before is not None:
            index = None
            for i in range(layout.count()):
                if layout.itemAt(i).widget() == before:
                    index = i
                    break
            
            if index is not None:
                layout.insertWidget(index, widget)
            else:
                layout.addWidget(widget)
            
        if align == Qt.AlignLeft:
            layout.insertWidget(0, widget)
        else:
            layout.addWidget(widget)
650424
public Cell<C,T> size (float width, float height) {
		size(new FixedValue<C, T>(layout.toolkit, width), new FixedValue<C, T>(layout.toolkit, height));
		return this;
	}
896666
function (width, height, animate) {
		var renderer = this,
			alignedObjects = renderer.alignedObjects,
			i = alignedObjects.length;

		renderer.width = width;
		renderer.height = height;

		renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({
			width: width,
			height: height
		});

		while (i--) {
			alignedObjects[i].align();
		}
	}
1244656
def setFixedHeight(self, height):
        
        super(XViewPanelBar, self).setFixedHeight(height)

        # update the layout
        if self.layout():
            for i in xrange(self.layout().count()):
                try:
                    self.layout().itemAt(i).widget().setFixedHeight(height)
                except StandardError:
                    continue
931207
def bar(self, width, **_):
        
        width -= self._width_offset
        self._position += self._direction

        # Change direction.
        if self._position <= 0 and self._direction < 0:
            self._position = 0
            self._direction = 1
        elif self._position > width:
            self._position = width - 1
            self._direction = -1

        final_bar = (
            self.CHAR_LEFT_BORDER +
            self.CHAR_EMPTY * self._position +
            self.CHAR_ANIMATED +
            self.CHAR_EMPTY * (width - self._position) +
            self.CHAR_RIGHT_BORDER
        )
        return final_bar
1205286
public void setDimension(int width, int height) {
        setWidth(String.valueOf(width));
        setHeight(String.valueOf(height));
        reload();
    }