1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
5 * Do ":help uganda" in Vim to read copying and usage conditions.
6 * Do ":help credits" in Vim to see a list of people who contributed.
7 * See README.txt for an overview of the Vim source code.
11 * (C) 1998,1999 by Marcin Dalecki <martin@dalecki.de>
13 * Support for GTK+ 2 was added by:
15 * (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
16 * Daniel Elstner <daniel.elstner@gmx.net>
18 * This is a special purpose container widget, which manages arbitrary
19 * children at arbitrary positions width arbitrary sizes. This finally puts
20 * an end on our resize problems with which we where struggling for such a
25 #include <gtk/gtk.h> /* without this it compiles, but gives errors at
27 #include "gui_gtk_f.h"
28 #include <gtk/gtksignal.h>
30 # include <gdk/gdkwin32.h>
32 # include <gdk/gdkx.h>
35 typedef struct _GtkFormChild GtkFormChild
;
41 gint x
; /* relative subwidget x position */
42 gint y
; /* relative subwidget y position */
47 static void gtk_form_class_init(GtkFormClass
*klass
);
48 static void gtk_form_init(GtkForm
*form
);
50 static void gtk_form_realize(GtkWidget
*widget
);
51 static void gtk_form_unrealize(GtkWidget
*widget
);
52 static void gtk_form_map(GtkWidget
*widget
);
53 static void gtk_form_size_request(GtkWidget
*widget
,
54 GtkRequisition
*requisition
);
55 static void gtk_form_size_allocate(GtkWidget
*widget
,
56 GtkAllocation
*allocation
);
57 #ifndef HAVE_GTK2 /* this isn't needed in gtk2 */
58 static void gtk_form_draw(GtkWidget
*widget
,
61 static gint
gtk_form_expose(GtkWidget
*widget
,
62 GdkEventExpose
*event
);
64 static void gtk_form_remove(GtkContainer
*container
,
66 static void gtk_form_forall(GtkContainer
*container
,
67 gboolean include_internals
,
69 gpointer callback_data
);
71 static void gtk_form_attach_child_window(GtkForm
*form
,
73 static void gtk_form_realize_child(GtkForm
*form
,
75 static void gtk_form_position_child(GtkForm
*form
,
77 gboolean force_allocate
);
78 static void gtk_form_position_children(GtkForm
*form
);
80 static GdkFilterReturn
gtk_form_filter(GdkXEvent
*gdk_xevent
,
83 static GdkFilterReturn
gtk_form_main_filter(GdkXEvent
*gdk_xevent
,
87 static void gtk_form_set_static_gravity(GdkWindow
*window
,
90 static void gtk_form_send_configure(GtkForm
*form
);
92 static void gtk_form_child_map(GtkWidget
*widget
, gpointer user_data
);
93 static void gtk_form_child_unmap(GtkWidget
*widget
, gpointer user_data
);
95 static GtkWidgetClass
*parent_class
= NULL
;
105 form
= gtk_type_new(gtk_form_get_type());
107 return GTK_WIDGET(form
);
111 gtk_form_put(GtkForm
*form
,
112 GtkWidget
*child_widget
,
118 g_return_if_fail(GTK_IS_FORM(form
));
120 /* LINTED: avoid warning: conversion to 'unsigned long' */
121 child
= g_new(GtkFormChild
, 1);
123 child
->widget
= child_widget
;
124 child
->window
= NULL
;
127 child
->widget
->requisition
.width
= 0;
128 child
->widget
->requisition
.height
= 0;
129 child
->mapped
= FALSE
;
131 form
->children
= g_list_append(form
->children
, child
);
133 /* child->window must be created and attached to the widget _before_
134 * it has been realized, or else things will break with GTK2. Note
135 * that gtk_widget_set_parent() realizes the widget if it's visible
136 * and its parent is mapped.
138 if (GTK_WIDGET_REALIZED(form
))
139 gtk_form_attach_child_window(form
, child
);
141 gtk_widget_set_parent(child_widget
, GTK_WIDGET(form
));
142 gtk_widget_size_request(child
->widget
, NULL
);
144 if (GTK_WIDGET_REALIZED(form
) && !GTK_WIDGET_REALIZED(child_widget
))
145 gtk_form_realize_child(form
, child
);
147 gtk_form_position_child(form
, child
, TRUE
);
151 gtk_form_move(GtkForm
*form
,
152 GtkWidget
*child_widget
,
159 g_return_if_fail(GTK_IS_FORM(form
));
161 for (tmp_list
= form
->children
; tmp_list
; tmp_list
= tmp_list
->next
)
163 child
= tmp_list
->data
;
164 if (child
->widget
== child_widget
)
169 gtk_form_position_child(form
, child
, TRUE
);
176 gtk_form_set_size(GtkForm
*form
, guint width
, guint height
)
178 g_return_if_fail(GTK_IS_FORM(form
));
180 /* prevent unneccessary calls */
181 if (form
->width
== width
&& form
->height
== height
)
184 form
->height
= height
;
186 /* signal the change */
188 gtk_widget_queue_resize(gtk_widget_get_parent(GTK_WIDGET(form
)));
190 gtk_container_queue_resize(GTK_CONTAINER(GTK_WIDGET(form
)->parent
));
195 gtk_form_freeze(GtkForm
*form
)
197 g_return_if_fail(GTK_IS_FORM(form
));
199 ++form
->freeze_count
;
203 gtk_form_thaw(GtkForm
*form
)
205 g_return_if_fail(GTK_IS_FORM(form
));
207 if (form
->freeze_count
)
209 if (!(--form
->freeze_count
))
211 gtk_form_position_children(form
);
213 gtk_widget_queue_draw(GTK_WIDGET(form
));
215 gtk_widget_draw(GTK_WIDGET(form
), NULL
);
221 /* Basic Object handling procedures
224 gtk_form_get_type(void)
226 static GtkType form_type
= 0;
230 GtkTypeInfo form_info
=
234 sizeof(GtkFormClass
),
235 (GtkClassInitFunc
) gtk_form_class_init
,
236 (GtkObjectInitFunc
) gtk_form_init
239 form_type
= gtk_type_unique(GTK_TYPE_CONTAINER
, &form_info
);
245 gtk_form_class_init(GtkFormClass
*klass
)
247 GtkWidgetClass
*widget_class
;
248 GtkContainerClass
*container_class
;
250 widget_class
= (GtkWidgetClass
*) klass
;
251 container_class
= (GtkContainerClass
*) klass
;
253 parent_class
= gtk_type_class(gtk_container_get_type());
255 widget_class
->realize
= gtk_form_realize
;
256 widget_class
->unrealize
= gtk_form_unrealize
;
257 widget_class
->map
= gtk_form_map
;
258 widget_class
->size_request
= gtk_form_size_request
;
259 widget_class
->size_allocate
= gtk_form_size_allocate
;
260 #ifndef HAVE_GTK2 /* not needed for GTK2 */
261 widget_class
->draw
= gtk_form_draw
;
263 widget_class
->expose_event
= gtk_form_expose
;
265 container_class
->remove
= gtk_form_remove
;
266 container_class
->forall
= gtk_form_forall
;
270 gtk_form_init(GtkForm
*form
)
272 form
->children
= NULL
;
277 form
->bin_window
= NULL
;
279 form
->configure_serial
= 0;
280 form
->visibility
= GDK_VISIBILITY_PARTIAL
;
282 form
->freeze_count
= 0;
290 gtk_form_realize(GtkWidget
*widget
)
294 GdkWindowAttr attributes
;
295 gint attributes_mask
;
297 g_return_if_fail(GTK_IS_FORM(widget
));
299 form
= GTK_FORM(widget
);
300 GTK_WIDGET_SET_FLAGS(form
, GTK_REALIZED
);
302 attributes
.window_type
= GDK_WINDOW_CHILD
;
303 attributes
.x
= widget
->allocation
.x
;
304 attributes
.y
= widget
->allocation
.y
;
305 attributes
.width
= widget
->allocation
.width
;
306 attributes
.height
= widget
->allocation
.height
;
307 attributes
.wclass
= GDK_INPUT_OUTPUT
;
308 attributes
.visual
= gtk_widget_get_visual(widget
);
309 attributes
.colormap
= gtk_widget_get_colormap(widget
);
310 attributes
.event_mask
= GDK_VISIBILITY_NOTIFY_MASK
;
312 attributes_mask
= GDK_WA_X
| GDK_WA_Y
| GDK_WA_VISUAL
| GDK_WA_COLORMAP
;
314 widget
->window
= gdk_window_new(gtk_widget_get_parent_window(widget
),
315 &attributes
, attributes_mask
);
316 gdk_window_set_user_data(widget
->window
, widget
);
320 attributes
.event_mask
= gtk_widget_get_events(widget
);
322 form
->bin_window
= gdk_window_new(widget
->window
,
323 &attributes
, attributes_mask
);
324 gdk_window_set_user_data(form
->bin_window
, widget
);
326 gtk_form_set_static_gravity(form
->bin_window
, TRUE
);
328 widget
->style
= gtk_style_attach(widget
->style
, widget
->window
);
329 gtk_style_set_background(widget
->style
, widget
->window
, GTK_STATE_NORMAL
);
330 gtk_style_set_background(widget
->style
, form
->bin_window
, GTK_STATE_NORMAL
);
332 gdk_window_add_filter(widget
->window
, gtk_form_main_filter
, form
);
333 gdk_window_add_filter(form
->bin_window
, gtk_form_filter
, form
);
335 for (tmp_list
= form
->children
; tmp_list
; tmp_list
= tmp_list
->next
)
337 GtkFormChild
*child
= tmp_list
->data
;
339 gtk_form_attach_child_window(form
, child
);
341 if (GTK_WIDGET_VISIBLE(child
->widget
))
342 gtk_form_realize_child(form
, child
);
347 /* After reading the documentation at
348 * http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
349 * I think it should be possible to remove this function when compiling
350 * against gtk-2.0. It doesn't seem to cause problems, though.
352 * Well, I reckon at least the gdk_window_show(form->bin_window)
353 * is necessary. GtkForm is anything but a usual container widget.
356 gtk_form_map(GtkWidget
*widget
)
361 g_return_if_fail(GTK_IS_FORM(widget
));
363 form
= GTK_FORM(widget
);
365 GTK_WIDGET_SET_FLAGS(widget
, GTK_MAPPED
);
367 gdk_window_show(widget
->window
);
368 gdk_window_show(form
->bin_window
);
370 for (tmp_list
= form
->children
; tmp_list
; tmp_list
= tmp_list
->next
)
372 GtkFormChild
*child
= tmp_list
->data
;
374 if (GTK_WIDGET_VISIBLE(child
->widget
)
375 && !GTK_WIDGET_MAPPED(child
->widget
))
376 gtk_widget_map(child
->widget
);
381 gtk_form_unrealize(GtkWidget
*widget
)
386 g_return_if_fail(GTK_IS_FORM(widget
));
388 form
= GTK_FORM(widget
);
390 tmp_list
= form
->children
;
392 gdk_window_set_user_data(form
->bin_window
, NULL
);
393 gdk_window_destroy(form
->bin_window
);
394 form
->bin_window
= NULL
;
398 GtkFormChild
*child
= tmp_list
->data
;
400 if (child
->window
!= NULL
)
402 gtk_signal_disconnect_by_func(GTK_OBJECT(child
->widget
),
403 GTK_SIGNAL_FUNC(gtk_form_child_map
),
405 gtk_signal_disconnect_by_func(GTK_OBJECT(child
->widget
),
406 GTK_SIGNAL_FUNC(gtk_form_child_unmap
),
409 gdk_window_set_user_data(child
->window
, NULL
);
410 gdk_window_destroy(child
->window
);
412 child
->window
= NULL
;
415 tmp_list
= tmp_list
->next
;
418 if (GTK_WIDGET_CLASS (parent_class
)->unrealize
)
419 (* GTK_WIDGET_CLASS (parent_class
)->unrealize
) (widget
);
424 gtk_form_draw(GtkWidget
*widget
, GdkRectangle
*area
)
429 GdkRectangle child_area
;
431 g_return_if_fail(GTK_IS_FORM(widget
));
433 if (GTK_WIDGET_DRAWABLE(widget
))
435 form
= GTK_FORM(widget
);
437 children
= form
->children
;
441 child
= children
->data
;
443 if (GTK_WIDGET_DRAWABLE(child
->widget
)
444 && gtk_widget_intersect(child
->widget
, area
, &child_area
))
445 gtk_widget_draw(child
->widget
, &child_area
);
447 children
= children
->next
;
451 #endif /* !HAVE_GTK2 */
454 gtk_form_size_request(GtkWidget
*widget
, GtkRequisition
*requisition
)
459 g_return_if_fail(GTK_IS_FORM(widget
));
461 form
= GTK_FORM(widget
);
463 requisition
->width
= form
->width
;
464 requisition
->height
= form
->height
;
466 tmp_list
= form
->children
;
470 GtkFormChild
*child
= tmp_list
->data
;
471 gtk_widget_size_request(child
->widget
, NULL
);
472 tmp_list
= tmp_list
->next
;
477 gtk_form_size_allocate(GtkWidget
*widget
, GtkAllocation
*allocation
)
481 gboolean need_reposition
;
483 g_return_if_fail(GTK_IS_FORM(widget
));
485 if (widget
->allocation
.x
== allocation
->x
486 && widget
->allocation
.y
== allocation
->y
487 && widget
->allocation
.width
== allocation
->width
488 && widget
->allocation
.height
== allocation
->height
)
491 need_reposition
= widget
->allocation
.width
!= allocation
->width
492 || widget
->allocation
.height
!= allocation
->height
;
493 form
= GTK_FORM(widget
);
497 tmp_list
= form
->children
;
501 GtkFormChild
*child
= tmp_list
->data
;
502 gtk_form_position_child(form
, child
, TRUE
);
504 tmp_list
= tmp_list
->next
;
508 if (GTK_WIDGET_REALIZED(widget
))
510 gdk_window_move_resize(widget
->window
,
511 allocation
->x
, allocation
->y
,
512 allocation
->width
, allocation
->height
);
513 gdk_window_move_resize(GTK_FORM(widget
)->bin_window
,
515 allocation
->width
, allocation
->height
);
517 widget
->allocation
= *allocation
;
519 gtk_form_send_configure(form
);
523 gtk_form_expose(GtkWidget
*widget
, GdkEventExpose
*event
)
528 g_return_val_if_fail(GTK_IS_FORM(widget
), FALSE
);
530 form
= GTK_FORM(widget
);
532 if (event
->window
== form
->bin_window
)
535 for (tmp_list
= form
->children
; tmp_list
; tmp_list
= tmp_list
->next
)
538 GtkFormChild
*formchild
= tmp_list
->data
;
539 GtkWidget
*child
= formchild
->widget
;
541 * The following chunk of code is taken from gtkcontainer.c. The
542 * gtk1.x code synthesized expose events directly on the child widgets,
543 * which can't be done in gtk2
545 if (GTK_WIDGET_DRAWABLE(child
) && GTK_WIDGET_NO_WINDOW(child
)
546 && child
->window
== event
->window
)
548 GdkEventExpose child_event
;
549 child_event
= *event
;
551 child_event
.region
= gtk_widget_region_intersect(child
, event
->region
);
552 if (!gdk_region_empty(child_event
.region
))
554 gdk_region_get_clipbox(child_event
.region
, &child_event
.area
);
555 gtk_widget_send_expose(child
, (GdkEvent
*)&child_event
);
558 #else /* !HAVE_GTK2 */
559 GtkFormChild
*child
= tmp_list
->data
;
561 if (event
->window
== child
->window
)
562 return gtk_widget_event(child
->widget
, (GdkEvent
*) event
);
563 #endif /* !HAVE_GTK2 */
572 gtk_form_remove(GtkContainer
*container
, GtkWidget
*widget
)
576 GtkFormChild
*child
= NULL
; /* init for gcc */
578 g_return_if_fail(GTK_IS_FORM(container
));
580 form
= GTK_FORM(container
);
582 tmp_list
= form
->children
;
585 child
= tmp_list
->data
;
586 if (child
->widget
== widget
)
588 tmp_list
= tmp_list
->next
;
595 gtk_signal_disconnect_by_func(GTK_OBJECT(child
->widget
),
596 GTK_SIGNAL_FUNC(>k_form_child_map
), child
);
597 gtk_signal_disconnect_by_func(GTK_OBJECT(child
->widget
),
598 GTK_SIGNAL_FUNC(>k_form_child_unmap
), child
);
600 /* FIXME: This will cause problems for reparenting NO_WINDOW
601 * widgets out of a GtkForm
603 gdk_window_set_user_data(child
->window
, NULL
);
604 gdk_window_destroy(child
->window
);
606 gtk_widget_unparent(widget
);
608 form
->children
= g_list_remove_link(form
->children
, tmp_list
);
609 g_list_free_1(tmp_list
);
616 gtk_form_forall(GtkContainer
*container
,
617 gboolean include_internals
,
618 GtkCallback callback
,
619 gpointer callback_data
)
625 g_return_if_fail(GTK_IS_FORM(container
));
626 g_return_if_fail(callback
!= NULL
);
628 form
= GTK_FORM(container
);
630 tmp_list
= form
->children
;
633 child
= tmp_list
->data
;
634 tmp_list
= tmp_list
->next
;
636 (*callback
) (child
->widget
, callback_data
);
640 /* Operations on children
644 gtk_form_attach_child_window(GtkForm
*form
, GtkFormChild
*child
)
646 if (child
->window
!= NULL
)
647 return; /* been there, done that */
649 if (GTK_WIDGET_NO_WINDOW(child
->widget
))
652 GdkWindowAttr attributes
;
653 gint attributes_mask
;
655 widget
= GTK_WIDGET(form
);
657 attributes
.window_type
= GDK_WINDOW_CHILD
;
658 attributes
.x
= child
->x
;
659 attributes
.y
= child
->y
;
660 attributes
.width
= child
->widget
->requisition
.width
;
661 attributes
.height
= child
->widget
->requisition
.height
;
662 attributes
.wclass
= GDK_INPUT_OUTPUT
;
663 attributes
.visual
= gtk_widget_get_visual(widget
);
664 attributes
.colormap
= gtk_widget_get_colormap(widget
);
665 attributes
.event_mask
= GDK_EXPOSURE_MASK
;
667 attributes_mask
= GDK_WA_X
| GDK_WA_Y
| GDK_WA_VISUAL
| GDK_WA_COLORMAP
;
668 child
->window
= gdk_window_new(form
->bin_window
,
669 &attributes
, attributes_mask
);
670 gdk_window_set_user_data(child
->window
, widget
);
672 gtk_style_set_background(widget
->style
,
676 gtk_widget_set_parent_window(child
->widget
, child
->window
);
677 gtk_form_set_static_gravity(child
->window
, TRUE
);
679 * Install signal handlers to map/unmap child->window
680 * alongside with the actual widget.
682 gtk_signal_connect(GTK_OBJECT(child
->widget
), "map",
683 GTK_SIGNAL_FUNC(>k_form_child_map
), child
);
684 gtk_signal_connect(GTK_OBJECT(child
->widget
), "unmap",
685 GTK_SIGNAL_FUNC(>k_form_child_unmap
), child
);
687 else if (!GTK_WIDGET_REALIZED(child
->widget
))
689 gtk_widget_set_parent_window(child
->widget
, form
->bin_window
);
694 gtk_form_realize_child(GtkForm
*form
, GtkFormChild
*child
)
696 gtk_form_attach_child_window(form
, child
);
697 gtk_widget_realize(child
->widget
);
699 if (child
->window
== NULL
) /* might be already set, see above */
700 gtk_form_set_static_gravity(child
->widget
->window
, TRUE
);
704 gtk_form_position_child(GtkForm
*form
, GtkFormChild
*child
,
705 gboolean force_allocate
)
713 if ((x
>= G_MINSHORT
) && (x
<= G_MAXSHORT
) &&
714 (y
>= G_MINSHORT
) && (y
<= G_MAXSHORT
))
718 if (GTK_WIDGET_MAPPED(form
) && GTK_WIDGET_VISIBLE(child
->widget
))
720 if (!GTK_WIDGET_MAPPED(child
->widget
))
721 gtk_widget_map(child
->widget
);
723 child
->mapped
= TRUE
;
724 force_allocate
= TRUE
;
730 GtkAllocation allocation
;
732 if (GTK_WIDGET_NO_WINDOW(child
->widget
))
736 gdk_window_move_resize(child
->window
,
738 child
->widget
->requisition
.width
,
739 child
->widget
->requisition
.height
);
751 allocation
.width
= child
->widget
->requisition
.width
;
752 allocation
.height
= child
->widget
->requisition
.height
;
754 gtk_widget_size_allocate(child
->widget
, &allocation
);
761 child
->mapped
= FALSE
;
763 if (GTK_WIDGET_MAPPED(child
->widget
))
764 gtk_widget_unmap(child
->widget
);
770 gtk_form_position_children(GtkForm
*form
)
774 for (tmp_list
= form
->children
; tmp_list
; tmp_list
= tmp_list
->next
)
775 gtk_form_position_child(form
, tmp_list
->data
, FALSE
);
780 /* The main event filter. Actually, we probably don't really need
781 * to install this as a filter at all, since we are calling it
782 * directly above in the expose-handling hack.
784 * This routine identifies expose events that are generated when
785 * we've temporarily moved the bin_window_origin, and translates
786 * them or discards them, depending on whether we are obscured
790 static GdkFilterReturn
791 gtk_form_filter(GdkXEvent
*gdk_xevent
, GdkEvent
*event
, gpointer data
)
796 xevent
= (XEvent
*) gdk_xevent
;
797 form
= GTK_FORM(data
);
799 switch (xevent
->type
)
802 if (xevent
->xexpose
.serial
== form
->configure_serial
)
804 if (form
->visibility
== GDK_VISIBILITY_UNOBSCURED
)
805 return GDK_FILTER_REMOVE
;
811 case ConfigureNotify
:
812 if ((xevent
->xconfigure
.x
!= 0) || (xevent
->xconfigure
.y
!= 0))
813 form
->configure_serial
= xevent
->xconfigure
.serial
;
817 return GDK_FILTER_CONTINUE
;
820 /* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
821 * there is no corresponding event in GTK, so we have
822 * to get the events from a filter
825 static GdkFilterReturn
826 gtk_form_main_filter(GdkXEvent
*gdk_xevent
, GdkEvent
*event
, gpointer data
)
831 xevent
= (XEvent
*) gdk_xevent
;
832 form
= GTK_FORM(data
);
834 if (xevent
->type
== VisibilityNotify
)
836 switch (xevent
->xvisibility
.state
)
838 case VisibilityFullyObscured
:
839 form
->visibility
= GDK_VISIBILITY_FULLY_OBSCURED
;
842 case VisibilityPartiallyObscured
:
843 form
->visibility
= GDK_VISIBILITY_PARTIAL
;
846 case VisibilityUnobscured
:
847 form
->visibility
= GDK_VISIBILITY_UNOBSCURED
;
851 return GDK_FILTER_REMOVE
;
853 return GDK_FILTER_CONTINUE
;
856 /* Routines to set the window gravity, and check whether it is
857 * functional. Extra capabilities need to be added to GDK, so
858 * we don't have to use Xlib here.
861 gtk_form_set_static_gravity(GdkWindow
*window
, gboolean use_static
)
864 gboolean static_gravity_supported
;
866 static_gravity_supported
= gdk_window_set_static_gravities(window
,
868 g_return_if_fail(static_gravity_supported
);
870 XSetWindowAttributes xattributes
;
872 xattributes
.win_gravity
= (use_static
) ? StaticGravity
: NorthWestGravity
;
873 xattributes
.bit_gravity
= (use_static
) ? StaticGravity
: NorthWestGravity
;
875 XChangeWindowAttributes(GDK_WINDOW_XDISPLAY(window
),
876 GDK_WINDOW_XWINDOW(window
),
877 CWBitGravity
| CWWinGravity
,
883 gtk_form_move_resize(GtkForm
*form
, GtkWidget
*widget
,
884 gint x
, gint y
, gint w
, gint h
)
886 widget
->requisition
.width
= w
;
887 widget
->requisition
.height
= h
;
889 gtk_form_move(form
, widget
, x
, y
);
893 gtk_form_send_configure(GtkForm
*form
)
896 GdkEventConfigure event
;
898 widget
= GTK_WIDGET(form
);
900 event
.type
= GDK_CONFIGURE
;
901 event
.window
= widget
->window
;
902 event
.x
= widget
->allocation
.x
;
903 event
.y
= widget
->allocation
.y
;
904 event
.width
= widget
->allocation
.width
;
905 event
.height
= widget
->allocation
.height
;
908 gtk_main_do_event((GdkEvent
*)&event
);
910 gtk_widget_event(widget
, (GdkEvent
*)&event
);
916 gtk_form_child_map(GtkWidget
*widget
, gpointer user_data
)
920 child
= (GtkFormChild
*)user_data
;
922 child
->mapped
= TRUE
;
923 gdk_window_show(child
->window
);
928 gtk_form_child_unmap(GtkWidget
*widget
, gpointer user_data
)
932 child
= (GtkFormChild
*)user_data
;
934 child
->mapped
= FALSE
;
935 gdk_window_hide(child
->window
);