cmdr
Check-in [defa6f6ead]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix small issue, clear header in a multi-line prompt, this is a fixed part we must not redraw on retry under this new scheme.
Timelines: family | ancestors | descendants | both | say-more
Files: files | file ages | folders
SHA1: defa6f6eadca9a5dd1b76defe8588fd4cff05c32
User & Date: andreask 2015-04-22 20:19:52
Context
2015-04-22
20:42
Split the example file into many, and moved into the proper section. check-in: d1f3c1d5ee user: andreask tags: say-more
20:19
Fix small issue, clear header in a multi-line prompt, this is a fixed part we must not redraw on retry under this new scheme. check-in: defa6f6ead user: andreask tags: say-more
20:13
Worked the low-level output into the ask package as demo of use. Especially made the retry loops visually tighter (temp display of error on bad input, plus reuse of existing line for re-input, no redraw of fixed parts (headers, menu listings)). check-in: 4f4b8b9a82 user: andreask tags: say-more
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ask.tcl.

   166    166   
   167    167   	# Show error for a second, then move back to the interaction
   168    168   	# line and retry (which overwrites the old string).
   169    169   	say add [color bad [Wrap "You must choose \"yes\" or \"no\""]]
   170    170   	after 1000
   171    171   	say rewind
   172    172   	say up
          173  +
          174  +	# Clear header to prevent redisplay, this part is fixed above
          175  +	# the actual input line.
          176  +	set header {}
   173    177       }
   174    178   
   175    179       return $response
   176    180   }
   177    181   
   178    182   proc ::cmdr::ask::choose {query choices {default {}}} {
   179    183       debug.cmdr/ask {}
................................................................................
   211    215   
   212    216   	# Show error for a second, then move back to the interaction
   213    217   	# line and retry (which overwrites the old string).
   214    218   	say add [color bad [Wrap "You must choose one of $lc"]]
   215    219   	after 1000
   216    220   	say rewind
   217    221   	say up
          222  +
          223  +	# Clear header to prevent redisplay, this part is fixed above
          224  +	# the actual input line.
          225  +	set header {}
   218    226       }
   219    227   
   220    228       return $response
   221    229   }
   222    230   
   223    231   proc ::cmdr::ask::menu {header prompt choices {default {}}} {
   224    232       debug.cmdr/ask {}
................................................................................
   282    290   
   283    291   	# Show error for a second, then move back to the interaction
   284    292   	# line and retry (which overwrites the old string).
   285    293   	say add [color bad [Wrap "You must choose one of the above"]]
   286    294   	after 1000
   287    295   	say rewind
   288    296   	say up
          297  +
          298  +	# Clear header to prevent redisplay, this part is fixed above
          299  +	# the actual input line.
          300  +	set pheader {}
   289    301       }
   290    302   
   291    303       return $response
   292    304   }
   293    305   
   294    306   # # ## ### ##### ######## ############# #####################
   295    307