- self->a_text->texture[0].data.text.string = text;
- RrMinsize(self->a_text, &textw, &texth);
- /*XXX textw += ob_rr_theme->bevel * 2;*/
- texth += ob_rr_theme->padding * 2;
+void popup_max_width(ObPopup *self, gint maxw)
+{
+ self->maxw = maxw;
+}
+
+void popup_height(ObPopup *self, gint h)
+{
+ gint texth;
+
+ /* don't let the height be smaller than the text */
+ texth = RrMinHeight(self->a_text) + ob_rr_theme->paddingy * 2;
+ self->h = MAX(h, texth);
+}
+
+void popup_text_width_to_string(ObPopup *self, gchar *text)
+{
+ if (text[0] != '\0') {
+ self->a_text->texture[0].data.text.string = text;
+ self->textw = RrMinWidth(self->a_text);
+ } else
+ self->textw = 0;
+}
+
+void popup_height_to_string(ObPopup *self, gchar *text)
+{
+ self->h = RrMinHeight(self->a_text) + ob_rr_theme->paddingy * 2;
+}
+
+void popup_text_width_to_strings(ObPopup *self, gchar **strings, gint num)
+{
+ gint i, maxw;