/* Set new caption for label, return false if out of mem.  */
bool wtk_label_change(struct wtk_label *label, const char *caption)
/* Set new caption for label, return false if out of mem.  */
bool wtk_label_change(struct wtk_label *label, const char *caption)
{
	Assert(label);
	Assert(caption);
	uint8_t new_len = strlen(caption);
	uint8_t old_len = 0;
	if (caption) {
		old_len = strlen(label->caption);
	}
	if (new_len > old_len) {
		if (caption) {
			membag_free(label->caption);
		}
		label->caption = membag_alloc((new_len + 1) * sizeof(char));
		if (!label->caption) {
			goto outofmem_caption;
		}
	}
	wtk_copy_string(label->caption, caption);
	win_redraw(label->container);
	return true;
outofmem_caption:
	return false;
}