ChimaraGlkPrivate *priv = CHIMARA_GLK_PRIVATE(widget);
/* For now, just pass the size request on to the root Glk window */
- if(priv->root_window)
+ if(priv->root_window)
+ {
request_recurse(priv->root_window->data, requisition);
- else {
- requisition->width = CHIMARA_GLK_MIN_WIDTH;
- requisition->height = CHIMARA_GLK_MIN_HEIGHT;
+ requisition->width += 2 * GTK_CONTAINER(widget)->border_width;
+ requisition->height += 2 * GTK_CONTAINER(widget)->border_width;
+ }
+ else
+ {
+ requisition->width = CHIMARA_GLK_MIN_WIDTH + 2 * GTK_CONTAINER(widget)->border_width;
+ requisition->height = CHIMARA_GLK_MIN_HEIGHT + 2 * GTK_CONTAINER(widget)->border_width;
}
}
widget->allocation = *allocation;
- if(priv->root_window)
- allocate_recurse(priv->root_window->data, allocation);
+ if(priv->root_window) {
+ GtkAllocation child;
+ child.x = allocation->x + GTK_CONTAINER(widget)->border_width;
+ child.y = allocation->y + GTK_CONTAINER(widget)->border_width;
+ child.width = allocation->width - 2 * GTK_CONTAINER(widget)->border_width;
+ child.height = allocation->height - 2 * GTK_CONTAINER(widget)->border_width;
+ allocate_recurse(priv->root_window->data, &child);
+ }
}
/* Recursively invoke callback() on the GtkWidget of each non-pair window in the tree */
gtk_builder_connect_signals(builder, NULL);
glk = chimara_glk_new();
+ g_object_set(glk, "border-width", 6, NULL);
chimara_glk_set_default_font_string(CHIMARA_GLK(glk), "Sans 11");
chimara_glk_set_monospace_font_string(CHIMARA_GLK(glk), "Monospace 10");
g_signal_connect(glk, "started", G_CALLBACK(on_started), NULL);