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
  
/* -*- C -*- */ 
require gtk210; 
class GTK2.Assistant; 
inherit GTK2.Window; 
 
//! Properties: 
//! <p> 
//! int complete 
//! GDK2.Pixbuf header-image 
//! GTK2.AssistantPageType page-type 
//! GDK2.Pixbuf sidebar-image 
//! string title 
//! <p> 
//! Style properties: 
//! <p> 
//! int content-padding 
//! int header-padding 
 
signal apply; 
signal cancel; 
signal close; 
signal prepare; 
 
%{ 
gint pgtk2_assistant_callback(gint cur_page, struct signal_data *d) { 
  gint res; 
  push_svalue(&d->args); 
  safe_apply_svalue(&d->cb, 2, 1); 
  res=(gint)Pike_sp[-1].u.integer; 
  pop_stack(); 
  return res; 
} 
 
%} 
 
//! A GTK2.Assistant is a widget used to represent a generally complex 
//! operation splitted in several steps, guiding the user through its pages 
//! and controlling the page flow to collect the necessary data. 
 
void create(?mapping(string:mixed) props) 
//! Create a new assistant. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    INIT_WITH_PROPS(GTK_TYPE_ASSISTANT); 
    pgtk2_pop_n_elems(args); 
  } else { 
    GtkWidget *gd; 
    gd=gtk_assistant_new(); 
    THIS->obj=G_OBJECT(gd); 
  } 
  pgtk2__init_this_object(); 
} 
 
int get_current_page(); 
//! Returns the page number of the current page.  Returns -1 if there are 
//! no pages. 
 
void set_current_page(int page_num); 
//! Switches the page to page_num. 
 
int get_n_pages(); 
//! Returns the number of pages. 
 
+GTK2.Widget get_nth_page(int page_num); 
//! Returnss the child widget contained in page number page_num. 
 
int prepend_page(GTK2.Widget page); 
//! Prepends a page to the assistant. 
 
int append_page(GTK2.Widget page); 
//! Appends a page to the assistant. 
 
int insert_page(GTK2.Widget page, int pos); 
//! Inserts a page at a given position.  If pos equals -1 it will append the 
//! page. 
 
void set_page_type(GTK2.Widget page, int type); 
//! Sets the page type for page.  The page type determines the page behavior. 
 
int get_page_type(GTK2.Widget page); 
//! Gets the page type of page. 
 
void set_page_title(GTK2.Widget page, string title); 
//! Sets a title for page. The title is displayed in the header area of the 
//! assistant when page is the current page. 
 
string get_page_title(GTK2.Widget page); 
//! Gets the title for page. 
 
void set_page_header_image(GTK2.Widget page, GDK2.Pixbuf pixbuf); 
//! Sets a header image for page.  This image is displayed in the header area 
//! of the assistant when page is the current page. 
 
+GDK2.Pixbuf get_page_header_image(GTK2.Widget page); 
//! Gets the header image for page. 
 
void set_page_side_image(GTK2.Widget page, GDK2.Pixbuf pixbuf); 
//! Sets a side image for page. This image is displayed in the side area of 
//! the assistant when page is the current page. 
 
+GDK2.Pixbuf get_page_side_image(GTK2.Widget page); 
//! Gets the side image for page. 
 
void set_page_complete(GTK2.Widget page, int complete); 
//! Sets whether page contents are complete. This will make assistant update 
//! the buttons state to be able to continue the task. 
 
int get_page_complete(GTK2.Widget page); 
//! Gets whether page is complete. 
 
void add_action_widget(GTK2.Widget child); 
//! Adds a widget to the action area. 
 
void remove_action_widget(GTK2.Widget child); 
//! Removes a widget from the action area. 
 
void update_buttons_state(); 
//! Forces the assistant to recompute the buttons state. 
//! <p> 
//! GTK+ automatically takes care of this in most situations, e.g. when the 
//! user goes to a different page, or when the visibility or completeness 
//! of a page changes. 
//! <p> 
//! One situation where it can be necessary to call this function is when 
//! changing a value on the current page affects the future page flow of the 
//! assistant. 
 
void set_forward_page_func(function f, mixed data) 
//! Set the forward page function. 
{ 
  struct svalue *sv1,*sv2; 
  struct signal_data *sd; 
 
  get_all_args(NULL,args,"%*%*",&sv1,&sv2); 
  sd=(struct signal_data *)g_malloc(sizeof(struct signal_data)); 
  if (sd==NULL) 
    SIMPLE_OUT_OF_MEMORY_ERROR("set_forward_page_func",sizeof(struct signal_data)); 
  assign_svalue_no_free(&sd->cb,sv1); 
  assign_svalue_no_free(&sd->args,sv2); 
  gtk_assistant_set_forward_page_func(GTK_ASSISTANT(THIS->obj),(GtkAssistantPageFunc)pgtk2_assistant_callback,sd,(GtkDestroyNotify)pgtk2_free_signal_data); 
  RETURN_THIS(); 
} 
 
 
endrequire;