home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7253 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: red-branch.MIT.EDU!not-for-mail
  2. From: rid@red-branch.MIT.EDU (Shawna or Lars Hansen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: time-like gadgets
  5. Date: 13 Apr 1996 02:22:21 GMT
  6. Organization: Massachvsetts Institvte of Technology
  7. Message-ID: <4kn34u$ppf@senator-bedfellow.MIT.EDU>
  8. References: <447.6673T637T93@mailbox.swipnet.se> <4kidsm$ci8@coli-gate.coli.uni-sb.de>
  9. NNTP-Posting-Host: red-branch.mit.edu
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Martin Recktenwald (mreckt@cscip.uni-sb.de) wrote on 11 Apr 1996 07:55:02 GMT:
  13. : Daniel Adolfsson (m-29431@mailbox.swipnet.se) wrote:
  14. : : 
  15. : : Can anyone point me in the right direction on how to create and update
  16. : : gadgets like the system program SYS:Prefs/Time does? (I mean how all the
  17. : : days gadgets change when you change the month). I just dont understand how
  18. : : I should do it (updating the gadgetlist or something like that..)
  19. : : 
  20. : I did something like this some time ago. I used 28 - 31 old-style gadgets
  21. : for the days; I removed them every time the month-gadget was pressed
  22. : and added them at their new position.
  23. : The only problem was getting the day of the week a month starts with.
  24. : If you really need it, I could dig out the source; but I really would
  25. : recommend writing it yourself, my source looks somehow ugly, and
  26. : implementing the thing as a BOOPSI gadget could be a good idea.
  27. : Regards,
  28. :    Martin.
  29. : -------------------------------------------------------------------------
  30. : If you can`t understand anything above, it`s because of my bad English.
  31. : However, I have the right to make faults, and you have the right
  32. : to mail them to me ;-)
  33. : -------------------------------------------------- mreckt@cscip.uni-sb.de
  34.  
  35. That really shouldn't be a problem. The tm struct as returned by 
  36. localtime() will give you the day_of_week. Setting the date as the first 
  37. of the month, and bouncing your prepared tm struct back and forth with 
  38. the standard time functions should give you the day_of_week of the first 
  39. day of the month. After that, it's easy placing the 'buttons' out 
  40. calendar style...
  41.  
  42. -- 
  43. * Lars M. Hansen              
  44.