|
|
@ -174,7 +174,6 @@ tcl::namespace::eval textblock { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
proc use_hash {args} { |
|
|
|
proc use_hash {args} { |
|
|
|
#set argd [punk::args::get_by_id ::textblock::use_hash $args] |
|
|
|
|
|
|
|
set argd [punk::args::parse $args withid ::textblock::use_hash] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::use_hash] |
|
|
|
variable use_hash |
|
|
|
variable use_hash |
|
|
|
if {![dict exists $argd received hash_algorithm]} { |
|
|
|
if {![dict exists $argd received hash_algorithm]} { |
|
|
@ -4169,7 +4168,6 @@ tcl::namespace::eval textblock { |
|
|
|
proc periodic {args} { |
|
|
|
proc periodic {args} { |
|
|
|
#For an impressive interactive terminal app (javascript) |
|
|
|
#For an impressive interactive terminal app (javascript) |
|
|
|
# see: https://github.com/spirometaxas/periodic-table-cli |
|
|
|
# see: https://github.com/spirometaxas/periodic-table-cli |
|
|
|
#set opts [dict get [punk::args::get_by_id ::textblock::periodic $args] opts] |
|
|
|
|
|
|
|
set opts [dict get [punk::args::parse $args withid ::textblock::periodic] opts] |
|
|
|
set opts [dict get [punk::args::parse $args withid ::textblock::periodic] opts] |
|
|
|
set opt_return [tcl::dict::get $opts -return] |
|
|
|
set opt_return [tcl::dict::get $opts -return] |
|
|
|
if {[tcl::dict::get $opts -forcecolour]} { |
|
|
|
if {[tcl::dict::get $opts -forcecolour]} { |
|
|
@ -4466,7 +4464,7 @@ tcl::namespace::eval textblock { |
|
|
|
|
|
|
|
|
|
|
|
proc list_as_table {args} { |
|
|
|
proc list_as_table {args} { |
|
|
|
set FRAMETYPES [textblock::frametypes] |
|
|
|
set FRAMETYPES [textblock::frametypes] |
|
|
|
set argd [punk::args::get_by_id ::textblock::list_as_table $args] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::list_as_table] |
|
|
|
|
|
|
|
|
|
|
|
set opts [dict get $argd opts] |
|
|
|
set opts [dict get $argd opts] |
|
|
|
set received [dict get $argd received] |
|
|
|
set received [dict get $argd received] |
|
|
@ -4714,7 +4712,7 @@ tcl::namespace::eval textblock { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
proc testblock {args} { |
|
|
|
proc testblock {args} { |
|
|
|
set argd [punk::args::get_by_id ::textblock::testblock $args] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::testblock] |
|
|
|
set colour [dict get $argd values colour] |
|
|
|
set colour [dict get $argd values colour] |
|
|
|
set size [dict get $argd opts -size] |
|
|
|
set size [dict get $argd opts -size] |
|
|
|
|
|
|
|
|
|
|
@ -5586,7 +5584,7 @@ tcl::namespace::eval textblock { |
|
|
|
|
|
|
|
|
|
|
|
#join without regard to each line length in a block (no padding added to make each block uniform) |
|
|
|
#join without regard to each line length in a block (no padding added to make each block uniform) |
|
|
|
proc ::textblock::join_basic {args} { |
|
|
|
proc ::textblock::join_basic {args} { |
|
|
|
set argd [punk::args::get_by_id ::textblock::join_basic $args] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::join_basic] |
|
|
|
set ansiresets [tcl::dict::get $argd opts -ansiresets] |
|
|
|
set ansiresets [tcl::dict::get $argd opts -ansiresets] |
|
|
|
set blocks [tcl::dict::get $argd values blocks] |
|
|
|
set blocks [tcl::dict::get $argd values blocks] |
|
|
|
|
|
|
|
|
|
|
@ -5930,7 +5928,7 @@ tcl::namespace::eval textblock { |
|
|
|
set table [[textblock::spantest] print] |
|
|
|
set table [[textblock::spantest] print] |
|
|
|
set punks [a+ web-lawngreen][>punk . lhs][a]\n\n[a+ rgb#FFFF00][>punk . rhs][a] |
|
|
|
set punks [a+ web-lawngreen][>punk . lhs][a]\n\n[a+ rgb#FFFF00][>punk . rhs][a] |
|
|
|
set ipunks [overtype::renderspace -width [textblock::width $punks] [punk::ansi::enable_inverse]$punks] |
|
|
|
set ipunks [overtype::renderspace -width [textblock::width $punks] [punk::ansi::enable_inverse]$punks] |
|
|
|
set testblock [textblock::testblock 15 rainbow] |
|
|
|
set testblock [textblock::testblock -size 15 rainbow] |
|
|
|
set contents $ansi\n[textblock::join -- " " $table " " $punks " " $testblock " " $ipunks " " $punks] |
|
|
|
set contents $ansi\n[textblock::join -- " " $table " " $punks " " $testblock " " $ipunks " " $punks] |
|
|
|
set framed [textblock::frame -checkargs 0 -type arc -title [a+ cyan]Compositing[a] -subtitle [a+ red]ANSI[a] -ansiborder [a+ web-orange] $contents] |
|
|
|
set framed [textblock::frame -checkargs 0 -type arc -title [a+ cyan]Compositing[a] -subtitle [a+ red]ANSI[a] -ansiborder [a+ web-orange] $contents] |
|
|
|
} |
|
|
|
} |
|
|
@ -7639,7 +7637,7 @@ tcl::namespace::eval textblock { |
|
|
|
} -help "Perform an action on the frame cache." |
|
|
|
} -help "Perform an action on the frame cache." |
|
|
|
} |
|
|
|
} |
|
|
|
proc frame_cache {args} { |
|
|
|
proc frame_cache {args} { |
|
|
|
set argd [punk::args::get_by_id ::textblock::frame_cache $args] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::frame_cache] |
|
|
|
set action [dict get $argd values action] |
|
|
|
set action [dict get $argd values action] |
|
|
|
variable frame_cache |
|
|
|
variable frame_cache |
|
|
|
set all_values_dict [dict get $argd values] |
|
|
|
set all_values_dict [dict get $argd values] |
|
|
@ -7684,7 +7682,7 @@ tcl::namespace::eval textblock { |
|
|
|
endindex -default "" -type indexexpression |
|
|
|
endindex -default "" -type indexexpression |
|
|
|
} |
|
|
|
} |
|
|
|
proc frame_cache_display {args} { |
|
|
|
proc frame_cache_display {args} { |
|
|
|
set argd [punk::args::get_by_id ::textblock::frame_cache_display $args] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::frame_cache_display] |
|
|
|
variable frame_cache |
|
|
|
variable frame_cache |
|
|
|
lassign [dict values [dict get $argd values]] startidx endidx |
|
|
|
lassign [dict values [dict get $argd values]] startidx endidx |
|
|
|
set limit "" |
|
|
|
set limit "" |
|
|
@ -7967,7 +7965,6 @@ tcl::namespace::eval textblock { |
|
|
|
#never need to checkargs if only one argument supplied even if it looks like an option - as it will be treated as data to frame |
|
|
|
#never need to checkargs if only one argument supplied even if it looks like an option - as it will be treated as data to frame |
|
|
|
if {[llength $args] != 1 && (!$opts_ok || $check_args)} { |
|
|
|
if {[llength $args] != 1 && (!$opts_ok || $check_args)} { |
|
|
|
#as frame is called a lot within table building - checking args can have a *big* impact on final performance. |
|
|
|
#as frame is called a lot within table building - checking args can have a *big* impact on final performance. |
|
|
|
#set argd [punk::args::get_by_id ::textblock::frame $args] |
|
|
|
|
|
|
|
set argd [punk::args::parse $args withid ::textblock::frame] |
|
|
|
set argd [punk::args::parse $args withid ::textblock::frame] |
|
|
|
set opts [dict get $argd opts] |
|
|
|
set opts [dict get $argd opts] |
|
|
|
set contents [dict get $argd values contents] |
|
|
|
set contents [dict get $argd values contents] |
|
|
|