Re: Blank ( null ) display in a Gnome2::DateEdit




On Jan 12, 2005, at 8:19 PM, Daniel Kasak wrote:

How would I go about blanking out a Gnome2::DateEdit, so that it doesn't display a date, and ( hopefully, but but absolutely necessary ) returns a NULL ( or undef, whatever ) value?

I can *sorta* get this effect with a Gtk2::Calendar by setting the day to 0 ( at least the display is blanked, and I can rely on the day that's returned being 0 and interpret the date as NULL later ), but I'm not having so much luck with the DateEdit.

looking at the source of GnomeDateEdit in libgnomeui, it appears that the widget is set up so that it always contains some valid date and time. so, er, you may not be able to.

you could set the unix timestamp to 0 and create a wrapper that returns undef if the timestamp is 0. ... mmm, that doesn't seem to work, though: after setting the value "0" in the date entry, i get this:

gish: print Dumper( $dateedit->get ('time') )
GLib-CRITICAL **: file gdate.c: line 1273 (g_date_to_struct_tm): assertion `g_date_valid (d)' failed at (eval 23) line 1, <FIN> line 18.
$VAR1 = 4294967295;
1


hrm.

--
If I lived in Teletubby Land, the homicide rate would be four.
  -- elysse




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]