1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
96
  
97
  
98
  
99
  
100
  
101
  
102
  
103
  
104
  
105
  
106
  
107
  
108
  
109
  
110
  
111
  
112
  
113
  
114
  
115
  
116
  
117
  
118
  
119
  
120
  
121
  
122
  
123
  
124
  
125
  
126
  
127
  
128
  
129
  
130
  
131
  
132
  
133
  
134
  
135
  
136
  
137
  
138
  
139
  
140
  
141
  
142
  
143
  
144
  
145
  
146
  
147
  
148
  
149
  
150
  
151
  
152
  
153
  
154
  
155
  
156
  
157
  
158
  
159
  
160
  
161
  
162
  
163
  
164
  
165
  
166
  
167
  
168
  
169
  
170
  
/* -*- C -*- */ 
class GTK2.Container; 
inherit GTK2.Widget; 
 
//! The basic container class. 
 
//! Properties: 
//! int border-width 
//! GTK2.Widget child 
//! int resize-mode CONST(GTK_RESIZE_) 
 
signal add; 
//! Called when a new object is added to the container. (used internally) 
signal check_resize; 
//! Called when the container needs resizing (used internally) 
signal remove; 
//! Called when a object is removed from the container (used internally) 
signal set_focus_child; 
 
void set_border_width( int external_border_width ); 
//! Set the border width. The border width is the size of the 
//! padding around the container. 
//! Calling this function might result in a resize of the container. 
 
void add(GTK2.Widget widget) 
//! Add a subwidget to the container. Don't forget to call show() in 
//! the subwidget. Some (even most) containers can only contain one child. 
//! Calling this function might result in a resize of the container. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct object *o1; 
    get_all_args(NULL,args,"%o",&o1); 
    gtk_container_add(GTK_CONTAINER(THIS->obj),GTK_WIDGET(get_gobject(o1))); 
  } 
  RETURN_THIS(); 
} 
 
void remove(GTK2.Widget widget); 
//! Remove a child from the container. The argument is the child to remove. 
//! Calling this function might result in a resize of the container. 
 
int get_resize_mode(); 
//! Returns the resize mode. 
 
void set_resize_mode(int mode); 
//! One of CONST(GTK_RESIZE) 
 
void check_resize(); 
//! Undocumented 
 
void set_reallocate_redraws(int setting); 
//! Sets the reallocate_redraws flag. 
 
/* SIMPLE_FUNCTION(block_resize); */ 
/* // (temporarily) disable all automatic resize actions */ 
/* SIMPLE_FUNCTION(unblock_resize); */ 
/* // reenable all automatic resize actions. */ 
 
array(GTK2.Widget) get_children() 
//! This function returns all children of the container 
//! as an array. 
{ 
  GList *g,*g1; 
  int n=0; 
  pgtk2_pop_n_elems(args); 
  g=g1=gtk_container_get_children(GTK_CONTAINER(THIS->obj)); 
  while (g1) { 
    push_gobject(g1->data); 
    n++; 
    g1=g_list_next(g1); 
  } 
  f_aggregate(n); 
  g_list_free(g); 
} 
 
void set_focus_child(GTK2.Widget child); 
//! Emulate a set_focus_child signal. Focus on the specified child. 
 
+GTK2.Adjustment get_focus_vadjustment(); 
//! Retrieves the vertical focus adjustment. 
 
void set_focus_vadjustment(GTK2.Adjustment adj); 
//! Set the vadjustment used to focus children. 
 
+GTK2.Adjustment get_focus_hadjustment(); 
//! Retrieves the horizontal focus adjustment. 
 
void set_focus_hadjustment(GTK2.Adjustment adj); 
//! Set the hadjustment used to focus children. 
 
void resize_children(); 
//! Undocumented. 
 
/* 
void child_set_property(GTK2.Widget child, string property, mixed value) 
//! Set child property. 
{ 
  pgtk2_verify_inited(); 
  pg2_object_set_property(args-1); 
} 
*/ 
 
int get_border_width(); 
//! Retrieves the border width. 
 
void set_border_width(int width); 
//! Sets the border width. 
 
array get_focus_chain() 
//! Returns the focus chain. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    GList *gl; 
    gtk_container_get_focus_chain(GTK_CONTAINER(THIS->obj),&gl); 
    if (gl==NULL) 
      ref_push_array(&empty_array); 
    else { 
      GList *g2=gl; 
      int i=0; 
      while (g2) { 
        push_gobject(g2->data); 
        g_object_ref(g2->data); 
        i++; 
        g2=g_list_next(g2); 
      } 
      f_aggregate(i); 
      g_list_free(gl); 
    } 
  } 
} 
 
void set_focus_chain(array focusable_widgets) 
//! Sets a focus chain, overriding the one computer automatically by GTK+. 
//! <p> 
//! In principle each widget in the chain should be a descendant of the 
//! container, but this is not enforced by this method, since it's allowed to 
//! set the focus chain before you pack the widgets, or have a widget in the 
//! chain that isn't always packed.  The necessary checks are done when the 
//! focus chain is actually traversed. 
{ 
  pgtk2_verify_inited(); 
  { 
    struct array *a; 
    get_all_args(NULL,args,"%A",&a); 
    if (a==NULL) 
      Pike_error("Invalid argument.\n"); 
    if (a->size) { 
      GList *gl = NULL; 
      int i; 
      GtkWidget *w; 
      for (i=0; i<a->size; i++) { 
        if (TYPEOF(ITEM(a)[i]) == PIKE_T_OBJECT) { 
          w=GTK_WIDGET(get_gobject((ITEM(a)+i)->u.object)); 
          gl=g_list_append(gl,w); 
        } 
      } 
      gtk_container_set_focus_chain(GTK_CONTAINER(THIS->obj),gl); 
    } 
  } 
  RETURN_THIS(); 
} 
 
/* 
void focus( int focus_direction ); 
//! Emulate a focus event. direction is one of CONST(GTK_DIR_). 
*/