Home Reference Source

vgui/30-label.js

/**
 * Represents a label element
 */
export class Label extends Panel {
	constructor(id) {
		super(id);
		this._attrHandler["labelText"] = "string";
	}

	/**
	 * Gets the text of the label
	 */
	get text() {
		return this.getAttribute("labelText");
	}
	/**
	 * Sets the text of the label
	 * @param {string} text
	 */
	set text(value) {
		return this.setAttribute("labelText", value);
	}
	
	/**
	 * @override
	 */
	toString() {
		return "Label[" + this.text + "]";
	}
}