hildon.CalendarPopup

hildon.CalendarPopup

A dialog which contains a gtk.Calendar.

Description

hildon.CalendarPopup is a dialog which contains a gtk.Calendar. It also contains arrow buttons for changing month/year. The earliest possible date is 1/1/1980 and the latest date 31/12/2100. If navigating with keyboard to a date that is not in the current month the calendar moves to the corresponding month. If the new date would be unallowed then an information banner will be shown. The usage of CalendarPopup is shown in the following code. This function should be connect to eg. button-press-event.

Ancestry

Up to the first non-hildon ancestor:

...
 +-- gtk.Dialog
      +-- hildon.CalendarPopup

Usage Example

import gtk
import hildon

def on_gather_date(widget, window, button):
    dialog = hildon.CalendarPopup (window, 2006, 04, 20)
    dialog.run()
    date_tuple = dialog.get_date()
    dialog.destroy()
    
    button.set_label("The date is (yy/mm/dd): %s/%s/%s" % date_tuple)

window = hildon.Window()
window.set_title("Test App")

button = gtk.Button("Click to enter a date")
window.add(button)
button.connect("clicked", on_gather_date, window, button)

window.show_all()

gtk.main()
      

Properties

Name Access Description
"min-year" Read/Write Minimum valid year.
"max-year" Read/Write Maximum valid year.
"day" Read/Write Currently selected day.
"month" Read/Write Currently selected month.
"year" Read/Write Currently selected year.

Constructor

This function returns a new hildon.CalendarPopup. The initially selected date is specified by the parameters (year, month, day). If the specified date is invalid, the current date is used.

hildon.CalendarPopup(parent, year, month, day)
parent parent window for dialog

year

initial year
month initial month
day initial day
Returns A new hildon.CalendarPopup widget.

Methods

set_date

This method activates a new date on the calendar popup.

hildon.CalendarPopup.set_date(year, month, day)
year A year
month A month
day A day

get_date

This method is used to get the currently selected year, month, and day.

hildon.CalendarPopup.get_date()
Returns A tuple of the form (year, month, day).


Improve this page