comparison src/gtk-xemacs.c @ 2168:95fee4a1420e

[xemacs-hg @ 2004-07-07 12:00:58 by malcolmp] Working GK tab_control widget. Other GTK widgets drawn with the correct location and size.
author malcolmp
date Wed, 07 Jul 2004 12:01:07 +0000
parents 91d4c8c65a0f
children 23d90a805259
comparison
equal deleted inserted replaced
2167:54e1ecdc5778 2168:95fee4a1420e
269 { 269 {
270 parent_class->size_request (widget, requisition); 270 parent_class->size_request (widget, requisition);
271 } 271 }
272 } 272 }
273 273
274 /* Assign a size and position to the child widgets. This differs from the
275 super class method in that for all widgets except the scrollbars the size
276 and position are not caclulated here. This is because these widgets have
277 this function performed for them by the redisplay code (see
278 gtk_map_subwindow()). If the superclass method is called then the widgets
279 can change size and position as the two pieces of code move the widgets at
280 random.
281 */
274 static void 282 static void
275 gtk_xemacs_size_allocate (GtkWidget *widget, GtkAllocation *allocation) 283 gtk_xemacs_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
276 { 284 {
277 GtkXEmacs *x = GTK_XEMACS (widget); 285 GtkXEmacs *x = GTK_XEMACS (widget);
286 GtkFixed *fixed = GTK_FIXED (widget);
278 struct frame *f = GTK_XEMACS_FRAME (x); 287 struct frame *f = GTK_XEMACS_FRAME (x);
279 int columns, rows; 288 int columns, rows;
280 289 GList *children;
281 parent_class->size_allocate(widget, allocation); 290 guint16 border_width;
291
292 widget->allocation = *allocation;
293 if (GTK_WIDGET_REALIZED (widget))
294 gdk_window_move_resize (widget->window,
295 allocation->x,
296 allocation->y,
297 allocation->width,
298 allocation->height);
299
300 border_width = GTK_CONTAINER (fixed)->border_width;
301
302 children = fixed->children;
303 while (children)
304 {
305 GtkFixedChild* child = children->data;
306 children = children->next;
307
308 /*
309 Scrollbars are the only widget that is managed by GTK. See
310 comments in gtk_create_scrollbar_instance().
311 */
312 if (GTK_WIDGET_VISIBLE (child->widget) &&
313 gtk_type_is_a(GTK_OBJECT_TYPE(child->widget), GTK_TYPE_SCROLLBAR))
314 {
315 GtkAllocation child_allocation;
316 GtkRequisition child_requisition;
317
318 gtk_widget_get_child_requisition (child->widget, &child_requisition);
319 child_allocation.x = child->x + border_width;
320 child_allocation.y = child->y + border_width;
321 child_allocation.width = child_requisition.width;
322 child_allocation.height = child_requisition.height;
323 gtk_widget_size_allocate (child->widget, &child_allocation);
324 }
325 }
282 326
283 if (f) 327 if (f)
284 { 328 {
285 f->pixwidth = allocation->width; 329 f->pixwidth = allocation->width;
286 f->pixheight = allocation->height; 330 f->pixheight = allocation->height;