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
  
/* -*- C -*- */ 
class GTK2.SizeGroup; 
inherit G.Object; 
 
//! Provides a mechanism for grouping a number of widgets together so they all 
//! request the same amount of space.  This is typically usefull when you want 
//! a column of widgets to have the same size, but you can't use a W(Table) 
//! widget. 
//! <p> 
//! In detail, the size requiest for each widget in a GTK2.SizeGroup is the 
//! maximum of the sizes that would have been requested for each widget in the 
//! size group if they were not in the size group.  The mode of the size group 
//! (see set_mode() determines whether this applies to the horizontal size, the 
//! vertical size, or both sizes. 
//! <p> 
//! Note that size groups only affect the amount of space requested, not the 
//! size that the widgets finally receive.  If you want the widgets in a 
//! GTK2.SizeGroup to actually be the same size, you need to pack them in such 
//! a way that they get the size they request and not more.  For example, if 
//! you are packing your widgets into a table, you would not include the 
//! GTK2.FILL flag. 
//! <p> 
//! GTK2.SizeGroup objects are referenced by each widget in the size group, so 
//! one you have added all widgets to a GTK2.SizeGroup, you can drop the initial 
//! reference to the size group.  If the widgets in the size group are 
//! subsequently destroyed, then they will be removed from the size group; when 
//! all widgets have been removed, the size group will be freed. 
//! <p> 
//! Widgets can be part of multiple size groups; GTK+ will compute the 
//! horizontal size of a widget from the horizontal requisition of all widgets 
//! that can be reached from the widget by a chain of size groups of type 
//! GTK2.SIZE_GROUP_HORIZONTAL or GTK2.SIZE_GROUP_BOTH, and the vertical size 
//! from the vertical requisition of all widgets that can be reached from the 
//! widget by a chain of size groups of type GTK2.SIZE_GROUP_VERTICAL or 
//! GTK2.SIZE_GROUP_BOTH. 
 
//! Properties: 
//! int mode 
//!    The directions in which the size group effects the requested sizes of 
//!    its componenent widgets. 
 
void create(int|mapping(string:mixed) mode_or_props) 
//! Create a new group. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (TYPEOF(Pike_sp[-args]) == PIKE_T_INT) { 
    INT_TYPE mode; 
    GtkSizeGroup *gs; 
    get_all_args(NULL,args,"%i",&mode); 
    gs=gtk_size_group_new(mode); 
    THIS->obj=G_OBJECT(gs); 
  } else { 
    INIT_WITH_PROPS(GTK_TYPE_SIZE_GROUP); 
  } 
  pgtk2_pop_n_elems(args); 
  pgtk2__init_this_object(); 
} 
 
void set_mode(int mode); 
//! Sets the mode of the size group.  One of CONST(GTK_SIZE_GROUP_).  The mode 
//! of the size group determines whether the widgets in the size group should 
//! all have the same horizontal requisition, all have the same vertical 
//! requisition, or should all have the same requisition in both directions. 
 
int get_mode(); 
//! Gets the current mode. 
 
require gtk28; 
void set_ignore_hidden(int setting); 
//! Sets whether invisible widgets should be ignored when calculating the size. 
 
int get_ignore_hidden(); 
//! Returns if invisible widgets are ignored when calculating the size. 
endrequire; 
 
void add_widget(GTK2.Widget widget); 
//! Adds a widget to the group.  In the future, the requisition of the widget 
//! will be determined as the maximum of its requisition and the requisition 
//! of the other widgets in the size group.  Whether this applies horizontally, 
//! vertically, or in both directions depends on the mode. 
 
void remove_widget(GTK2.Widget widget); 
//! Removes a widget. 
 
require gtk210; 
array(GTK2.Widget) get_widgets() 
//! Returns the list of widgets associated with this size group. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    GSList *gsl; 
    int i=0; 
 
    gsl=gtk_size_group_get_widgets(GTK_SIZE_GROUP(THIS->obj)); 
    while (gsl) { 
      push_gobject(gsl->data); 
      g_object_ref(GTK_WIDGET(gsl->data)); 
      i++; 
      gsl=g_slist_next(gsl); 
    } 
    f_aggregate(i); 
  } 
} 
endrequire;