home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / tcl / 1881 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.7 KB  |  59 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!wupost!sdd.hp.com!think.com!rpi!utcsri!skule.ecf!torn!nott!bnrgate!bcars267!scoob
  3. From: scoob@bnr.ca (Christian Marcotte)
  4. Subject: RadioButtons variable problem!!!
  5. Message-ID: <1992Nov19.054911.18804@bnr.ca>
  6. Sender: news@bnr.ca (usenet)
  7. Nntp-Posting-Host: cooma
  8. Organization: Bell-Northern Research, Ontario, Canada
  9. Date: Thu, 19 Nov 1992 05:49:11 GMT
  10. Lines: 47
  11.  
  12.  
  13. I have this strange problem with my radiobuttons:
  14.  
  15. In my application (modified from the mkRadio demo in tk) I do the
  16. following:
  17.  
  18.      ...
  19.     radiobutton .frame.Months.$month -text $month -variable month \
  20.         -relief flat -value $month 
  21.      ...
  22.  
  23. Later I set the default to the current month:
  24.  
  25.     .frame.Months.$currentMonth invoke
  26.  
  27. And finally I have a button that will call another command with
  28. the values collected from the radio buttons selections.
  29.  
  30.     button .cmdBar.day_select -text " Day Selection " \
  31.         -command "day_selection {$base_dir/$year/$typeOfAsset/$month \
  32.                   $typeOfAsset $month $year}"
  33.  
  34.  
  35. When I test the value of my buttons by adding a call to showVars.tcl (also 
  36. from the tk demo) I can see that my variables are properly set when I press
  37. the buttons.
  38.  
  39.  
  40. However, when I press the " Day Selection " button, it invariably passes
  41. the default values that I had set using "invoke".
  42.  
  43. I understand that it must have something to do with delaying the evaluation of
  44. the variable but I'm not sure exactly how to correct this.
  45.  
  46. Any guru advices...
  47.  
  48. Thanks
  49.  
  50. -- scoob
  51.  
  52.  
  53.  
  54. -- 
  55. ---------------------------------------------------------------------------
  56. Christian Marcotte                Bell-Northern Research
  57. scoob@bnr.ca                      3500 Carling Ave
  58. Telephone: (613) 763-2782         Nepean, Ont., Canada K1Y 4H7
  59.