Page 1 of 1

How to put 'unknown' in a dategadget?

Posted: Tue Dec 05, 2023 3:38 pm
by MrCor
Hi guys and dolls,

I want to use the dategadget. Initial I want to put 'Unknown' in there - no problem so far.
But when I want to select a real date and so use the gadget what it is there for, it will not allow me to do that.
Suggestions or is it just the way it is?

Thanks in advance.

MrCor

Re: How to put 'unknown' in a dategadget?

Posted: Tue Dec 05, 2023 4:42 pm
by normeus
From help file
are you doing this?

Code: Select all

  DateGadget(0, 10, 10, 210, 25, "unknown")
then you have to change the MASK to a MASK that displays the date, at the location where you handle the events for DateGadget:

Code: Select all

             Select EventType()
              Case #PB_EventType_Change:SetGadgetText(0,"Date: %mm/%dd/%yyyy Time: %hh:%ii")
            EndSelect
If you post some code, you will get a lot more help.

Norm.

Re: How to put 'unknown' in a dategadget?

Posted: Tue Dec 05, 2023 10:05 pm
by BarryG
MrCor wrote: Tue Dec 05, 2023 3:38 pmI want to put 'Unknown' in there - no problem so far.
Yes, there is: you can't put custom text or generic messages in a DateGadget; you can just set a text mask for the date in it, as normeus said.

DateGadgets do not operate like TextGadgets, and in your example the string "Unknown" is the mask you set, so later trying to set a date in there won't work, because the mask of "Unknown" doesn't support any date information.