4 #Displays a calendar and allows the user to select a date
5 #@https://developer.gnome.org/gtk3/3.2/GtkCalendar.html
6 extern GtkCalendar `{GtkCalendar *`}
10 return (GtkCalendar *)gtk_calendar_new
();
13 fun month=( month : Int, year : Int ) is extern `{
14 gtk_calendar_select_month
( recv
, month
, year
);
17 fun day=( day : Int ) is extern `{
18 gtk_calendar_select_day
( recv
, day
);
21 fun mark_day( day : Int ) is extern `{
22 gtk_calendar_mark_day
( recv
, day
);
25 fun unmark_day( day : Int ) is extern `{
26 gtk_calendar_unmark_day
( recv
, day
);
29 fun is_marked( day : Int ): Bool is extern `{
30 return gtk_calendar_get_day_is_marked
( recv
, day
);
33 fun clear_marks is extern `{
34 gtk_calendar_clear_marks
( recv
);
37 fun display_options : GtkCalendarDisplayOptions is extern `{
38 return gtk_calendar_get_display_options
( recv
);
42 fun display_options=( options : GtkCalendarDisplayOptions) is extern `{
43 gtk_calendar_set_display_options
( recv
, options
);
47 fun date: String is abstract
50 #enum GtkCalendarDisplayOptions
51 #@https://developer.gnome.org/gtk3/3.2/GtkCalendar.html#GtkCalendarDisplayOptions
52 extern GtkCalendarDisplayOptions `{GtkCalendarDisplayOptions`}
53 new show_heading
`{ return GTK_CALENDAR_SHOW_HEADING; `}
54 new show_day_names `{ return GTK_CALENDAR_SHOW_DAY_NAMES; `}
55 new no_month_change
`{ return GTK_CALENDAR_NO_MONTH_CHANGE; `}
56 new show_week_numbers `{ return GTK_CALENDAR_SHOW_WEEK_NUMBERS; `}
57 new show_details
`{ return GTK_CALENDAR_SHOW_DETAILS; `}
61 #@https://developer.gnome.org/gtk3/stable/GtkSeparator.html
62 extern GtkSeparator `{GtkSeparator *`}
65 new ( orientation
: GtkOrientation ) is extern `{
66 return (GtkSeparator *)gtk_separator_new( orientation );
71 #A widget which indicates progress visually
72 #@https://developer.gnome.org/gtk3/3.2/GtkProgressBar.html
73 extern GtkProgressBar `{GtkProgressBar *`}
77 return (GtkProgressBar *)gtk_progress_bar_new
();
80 fun pulse is extern `{
81 gtk_progress_bar_pulse
( recv
);
84 fun pulse_step : Float is extern `{
85 return gtk_progress_bar_get_pulse_step
( recv
);
88 fun pulse_step=( step : Float ) is extern `{
89 gtk_progress_bar_set_pulse_step
( recv
, step
);
92 fun fraction : Float is extern `{
93 return gtk_progress_bar_get_fraction
( recv
);
96 fun fraction=( fraction : Float) is extern `{
97 gtk_progress_bar_set_fraction
( recv
, fraction
);
100 fun inverted : Bool is extern `{
101 return gtk_progress_bar_get_inverted
( recv
);
104 fun inverted=( is_inverted : Bool) is extern `{
105 gtk_progress_bar_set_inverted
( recv
, is_inverted
);
108 fun show_text : Bool is extern `{
109 return gtk_progress_bar_get_show_text
( recv
);
112 fun show_text=( show : Bool) is extern `{
113 gtk_progress_bar_set_show_text
( recv
, show
);
116 fun text : String is extern import String::to_cstring`{
117 return new_String_from_cstring
( (char
*)gtk_progress_bar_get_text
( recv
) );
120 fun text=( value : String) is extern import String::to_cstring`{
121 gtk_progress_bar_set_text
( recv
, String_to_cstring( value
) );
124 fun ellipsize is abstract
128 extern GtkColorSelectionDialog
130 new ( title : String, parent : GtkWindow ) is extern import String::to_cstring `{
131 return gtk_color_chooser_dialog_new
( String_to_cstring( title
), parent
);
134 #fun color_selection : is extern `{
135 # return gtk_color_selection_dialog_get_color_selection( GTK_COLOR_SELECTION_DIALOG( recv ) );
138 #fun color : Float is extern `{
139 # return gtk_color_selection_dialog_get_color_selection( GTK_COLOR_SELECTION_DIALOG( recv ) );
143 #Retrieve an integer or floating-point number from the user
144 #@https://developer.gnome.org/gtk3/3.2/GtkSpinButton.html
145 extern GtkSpinButton `{GtkSpinButton *`}
148 new ( adjustment : GtkAdjustment, climb_rate : Float, digits : Int )is extern `{
149 return (GtkSpinButton *)gtk_spin_button_new
( adjustment
, climb_rate
, digits
);
152 new with_range( min : Float, max : Float, step : Float )is extern `{
153 return (GtkSpinButton *)gtk_spin_button_new_with_range
( min
, max
, step
);
156 fun configure ( adjustment : GtkAdjustment, climb_rate : Float, digits : Int ) is extern `{
157 gtk_spin_button_configure
( recv
, adjustment
, climb_rate
, digits
);
160 fun adjustment : GtkAdjustment is extern `{
161 return gtk_spin_button_get_adjustment
( recv
);
164 fun adjustment=( value : GtkAdjustment ) is extern `{
165 gtk_spin_button_set_adjustment
( recv
, value
);
168 fun digits : Int is extern `{
169 return gtk_spin_button_get_digits
( recv
);
172 fun digits=( nb_digits : Int ) is extern `{
173 gtk_spin_button_set_digits
( recv
, nb_digits
);
176 fun value : Float is extern `{
177 return gtk_spin_button_get_value
( recv
);
180 fun val=( val : Float ) is extern `{
181 gtk_spin_button_set_value
( recv
, val
);
184 fun spin( direction : GtkSpinType, increment : Float ) is extern`{
185 gtk_spin_button_spin
( recv
, direction
, increment
);
190 #The values of the GtkSpinType enumeration are used to specify the change to make in gtk_spin_button_spin().
191 #@https://developer.gnome.org/gtk3/stable/GtkSpinButton.html#GtkSpinType
192 extern GtkSpinType `{GtkSpinType`}
193 #Increment by the adjustments step increment.
194 new step_forward
`{ return GTK_SPIN_STEP_FORWARD; `}
196 #Decrement by the adjustments step increment.
197 new step_backward `{ return GTK_SPIN_STEP_BACKWARD; `}
199 #Increment by the adjustments page increment.
200 new page_forward
`{ return GTK_SPIN_PAGE_FORWARD; `}
202 #Decrement by the adjustments page increment.
203 new page_backward `{ return GTK_SPIN_PAGE_BACKWARD; `}
205 #Go to the adjustments lower bound.
206 new lower_bound
`{ return GTK_SPIN_HOME; `}
208 #Go to the adjustments upper bound.
209 new upper_bound `{ return GTK_SPIN_END; `}
211 #Change by a specified amount.
212 new user_defined
`{ return GTK_SPIN_USER_DEFINED; `}
215 #An entry which shows a search icon
216 #@https://developer.gnome.org/gtk3/stable/GtkSearchEntry.html
217 extern GtkSearchEntry `{GtkSearchEntry *`}
221 return (GtkSearchEntry *)gtk_search_entry_new( );
225 #A widget to unlock or lock privileged operations
226 #@https://developer.gnome.org/gtk3/stable/GtkLockButton.html
231 #A button to launch a color selection dialog
232 #@https://developer.gnome.org/gtk3/stable/GtkColorButton.html
233 extern GtkColorButton `{GtkColorButton *`}
237 return (GtkColorButton *)gtk_color_button_new
( );
240 fun color=( col : GdkColor ) is extern `{
243 GdkColor *c
= malloc
(sizeof
(GdkColor));
249 gtk_color_button_set_color
( (GtkColorButton*)recv
, c
);*/