gtk_spin_button_set_digits (GTK_SPIN_BUTTON (priv->spnMinutes), 0);
gtk_spin_button_set_digits (GTK_SPIN_BUTTON (priv->spnSeconds), 0);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->spnHours, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (priv->hbox), priv->lblMinutes, TRUE, TRUE, 3);
+ gtk_box_pack_start (GTK_BOX (priv->hbox), priv->lblMinutes, FALSE, FALSE, 3);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->spnMinutes, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (priv->hbox), priv->lblSeconds, TRUE, TRUE, 3);
+ gtk_box_pack_start (GTK_BOX (priv->hbox), priv->lblSeconds, FALSE, FALSE, 3);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->spnSeconds, TRUE, TRUE, 0);
gtk_widget_show (priv->spnHours);
gtk_widget_show (priv->lblMinutes);
gchar *format_;
GDate *gdate;
+ g_return_val_if_fail (GTK_IS_DATE_ENTRY (date), FALSE);
+ g_return_val_if_fail (format != NULL, FALSE);
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
- if (format == NULL)
- {
- return FALSE;
- }
-
format_ = g_strstrip (g_strdup (format));
if (strlen (format_) != 3)
{
GDateMonth gmon;
GDateYear gyear;
+ g_return_val_if_fail (GTK_IS_DATE_ENTRY (date), NULL);
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
gday = G_DATE_BAD_DAY;
gint minute;
gdouble seconds;
+ g_return_val_if_fail (GTK_IS_DATE_ENTRY (date), NULL);
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
gdate = gtk_date_entry_get_gdate (date);
gint i;
gint pos = 0;
+ g_return_val_if_fail (GTK_IS_DATE_ENTRY (date), FALSE);
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
if (format == NULL)
gint i;
gchar *txt;
- if (gdate == NULL || !g_date_valid (gdate)) return;
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+ g_return_if_fail (gdate != NULL && g_date_valid (gdate));
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
{
GDate *gdate;
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
gdate = g_date_new_dmy (g_date_time_get_year ((GDateTime *)gdatetime),
{
GDateTime *gdatetime;
+ g_return_val_if_fail (GTK_IS_DATE_ENTRY (date), FALSE);
+
gdatetime = gtk_date_entry_get_gdatetime (date);
if (gdatetime != NULL)
{
gtk_date_entry_set_editable (GtkDateEntry *date,
gboolean is_editable)
{
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
gtk_editable_set_editable (GTK_EDITABLE (priv->day), is_editable);
gtk_date_entry_set_editable_with_calendar (GtkDateEntry *date,
gboolean is_editable_with_calendar)
{
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
gtk_editable_set_editable (GTK_EDITABLE (priv->day), !is_editable_with_calendar);
gtk_date_entry_set_calendar_button_visible (GtkDateEntry *date,
gboolean is_visible)
{
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
if (is_visible)
gtk_date_entry_set_time_visible (GtkDateEntry *date,
gboolean is_visible)
{
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
priv->time_is_visible = is_visible;
gchar *mask, *format[3];
gint i;
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE (date);
for (i = 0; i < 3; i++)
static void
hide_popup (GtkWidget *date)
{
+ g_return_if_fail (GTK_IS_DATE_ENTRY (date));
+
GtkDateEntryPrivate *priv = GTK_DATE_ENTRY_GET_PRIVATE ((GtkDateEntry *)date);
gtk_widget_hide (priv->wCalendar);