gtk-sharp0.0.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Display a calendar and/or allow the user to select a date.With a Calendar widget, dates are presented to the user one month at a time. Additional information and decorations can be added to the Calendar by using the enumeration with the property.Days can be highlighted on the Calendar with or .The following example shows a method that creates a simple calendar displaying day names, headings and week numbers. (These are controlled by passing elements of the type to the method).
// Create a calendar with some simple display options
public Calendar CreateCalendar ()
{
Calendar cal = new Calendar ();
cal.DisplayOptions = CalendarDisplayOptions.ShowHeading |
CalendarDisplayOptions.ShowDayNames |
CalendarDisplayOptions.ShowWeekNumbers;
return cal;
}
The following example shows a typical event handler or capturing the selected date whenever it changes.
// Typical event handler for capturing the selected date
void DaySelected (object obj, EventArgs args)
{
Calendar activatedCalendar = (Calendar) obj;
Console.WriteLine (activatedCalendar.GetDate ().ToString ("yyyy/MM/dd"));
}
Gtk.WidgetAtk.ImplementorGLib.IWrapperGLib.IWrapperSystem.IDisposableMethodSystem.BooleanRemoves a visual marker from the specified .
A day number from 1 to 31.
Visual markers are added to the calendar with .MethodSystem.BooleanAdds a visual marker to the specified .
A day number from 1 to 31.
MethodSystem.VoidSet the display options for this calendar.
One or more values from , combined using a bit-wise OR.
This method allows fine control over which parts of the calendar, such as day names, are displayed. The describe the choices in more detail.MethodSystem.VoidSelect a specified day on the displayed month.
A day number from 1 to 31.
A value of 0 for the will unselect the currently selected day.MethodSystem.VoidStops the calendar from visually updating.If used before a large number of graphical updates, (such as calls to ), this method may prevent flicker. Once a batch of updates has taken place, call to render them.MethodSystem.VoidRetrieve the selected date.
A variable to place the chosen year in.
A variable to place the chosen month in.
A variable to place the chosen day in.
NOTE: That month number is ZERO based, (0-11), whereas the day is one based, (1-31).MethodSystem.VoidRemoves the effects of calling .This draws all graphical updates to the calendar that have happened since a .MethodSystem.VoidRemoves all visual marks that have been added to dates.MethodSystem.BooleanShifts the calendar to display the specified month.
A zero-based month number.
The year the month is in.
MethodSystem.VoidDisposes the resources associated with the object.ConstructorInternal constructor
Pointer to the C object.
An instance of Calendar, wrapping the C object.This is an internal constructor, and should not be used by user code.ConstructorCreates a new calendar displaying the current month.A new Calendar.PropertySystem.UInt32The GLib Type for Gtk.CalendarThe GLib Type for the Gtk.Calendar class.EventTo be addedTo be addedEventTo be addedTo be addedEventTo be addedTo be addedEventTo be addedTo be addedEventTo be addedTo be addedEventTo be addedTo be addedEventTo be addedTo be addedConstructorInternal constructor
GLib type for the type
Creates a new instance of Calendar, using the GLib-provided typeThis is a constructor used by derivative types of that would have their own GLib type assigned to it. This is not typically used by C# code.PropertyGtk.CalendarDisplayOptionsTo be added
To be added: an object of type 'Gtk.CalendarDisplayOptions'
To be added: an object of type 'Gtk.CalendarDisplayOptions'To be addedMethodSystem.DateTimeTo be addedTo be added: an object of type 'DateTime'To be added