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
  
/* -*- C -*- */ 
class GTK2.Calendar; 
inherit GTK2.Widget; 
 
//! A calendar widget. 
//! IMG: GTK2.Calendar(); 
//! IMG: GTK2.Calendar()->select_day( 16 ); 
 
//! Properties: 
//! int day 
//! int month 
//! int no-month-change 
//! int show-day-names 
//! int show-heading 
//! int show-week-numbers 
//! int year 
 
signal day_selected; 
signal day_selected_double_click; 
signal month_changed; 
signal next_month; 
signal next_year; 
signal prev_month; 
signal prev_year; 
 
void create(?mapping(string:mixed) props) 
//! Create a new calendar widget 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    INIT_WITH_PROPS(GTK_TYPE_CALENDAR); 
    pgtk2_pop_n_elems(args); 
  } else { 
    GtkWidget *gc; 
    gc=gtk_calendar_new(); 
    THIS->obj=G_OBJECT(gc); 
  } 
  pgtk2__init_this_object(); 
} 
 
int select_month(int month, int year); 
//! Select the month to be viewed. 
 
void select_day(int day_of_month); 
//! Select a certain day of the currently selected month 
 
void mark_day(int day_of_month); 
//! Mark a day 
 
void unmark_day(int day_of_month); 
//! Unmark a day 
 
void clear_marks(); 
//! Remove all day markers 
 
require gtk24; 
int get_display_options(); 
//! Returns the current display options. 
 
void set_display_options(int options); 
//! Bitwise or of one or more of CONST(GTK_CALENDAR). 
endrequire; 
 
mapping get_date() 
//! returns a mapping:<br /> 
//! ([ "year":year, "month":month, "day":day ]) 
{ 
  guint y, m, d; 
  gtk_calendar_get_date(GTK_CALENDAR(THIS->obj),&y,&m,&d); 
  pgtk2_pop_n_elems(args); 
  ref_push_string(_STR("year")); 
  push_int(y); 
  ref_push_string(_STR("month")); 
  push_int(m); 
  ref_push_string(_STR("day")); 
  push_int(d); 
  f_aggregate_mapping(6); 
} 
 
void freeze(); 
 
//! Suspend all dynamic updating of the widget 
void thaw(); 
//! Resume dynamic updating of the widget 
 
array(int) get_marked_dates() 
//! Returns an array (with 31 elements) with 1es and 0es. 
{ 
  int i; 
  pgtk2_pop_n_elems(args); 
  for(i=0; i<31; i++) 
    push_int(GTK_CALENDAR(THIS->obj)->marked_date[i]); 
  f_aggregate(31); 
} 
 
/* 
array(array(int)) get_day_month() 
//! Return an array of 6x7 days, representing the cells in the 
//! currently viewed calendar month.  The value is the day of month. 
{ 
  int i,j; 
  for(i=0; i<6; i++) { 
    for(j=0; j<7; i++) 
      push_int(GTK_CALENDAR(THIS->obj)->day_month[i][j]); 
    f_aggregate(7); 
  } 
  f_aggregate(6); 
} 
 
array(array(int)) get_day() 
//! Return an array of 6x7 days, representing the cells in the 
//! currently viewed calendar month. 
{ 
  int i,j; 
  for(i=0; i<6; i++) 
  { 
    for(j=0; j<7; i++) 
      push_int( GTK_CALENDAR( THIS->obj )->day[i][j] ); 
    f_aggregate( 7 ); 
  } 
  f_aggregate( 6 ); 
} 
 
void set_marked_date_color(int index, GDK2.Color color) 
//! Set the color to use to mark dates 
{ 
  INT_TYPE n; 
  struct object *o; 
  get_all_args(NULL,args,"%i%o",&n,&o); 
  if(!get_gdkobject(o,color)) 
    Pike_error("Argument 2 is not a GDK2.Color object\n"); 
  n--; 
  if(n > 30 || n<0) 
    Pike_error("Argument 1 is not between 1 and 31, inclusive\n"); 
  GTK_CALENDAR( THIS->obj )->marked_date_color[n] = 
                *(GdkColor*)get_gdkobject(o, color); 
  RETURN_THIS(); 
} 
 
*/