- To add UDP sockets to the core. i am beginning my experimentations for that;
- To create a windowframe widget for MDI interfaces;
- To collaborate with danielk1977 for adding javascript to tkhtml control;
- To make the radiobuttons have a selectbackgroundcolor in optionadd command;
- Girls :P ... and so many more.
lassignfor shortening builtin function calls as one-letters, but code became longer! GRRRR...I welcome any person to improve it the live collaboration on http://rextester.com/live/TXXTC91739 and tell it on my answer's comments.<LAM 20-12-2016>What about this?:
regsub -all {[^\n|]} [set b [string map {|||| ||| $ "BS " % "TAB " & "CAPS " ? "ENTER" * "SHIFT "} [regsub -all {(\S)} "`1234567890-=$\n%QWERTYUIOP\[\]\\\n&ASDFGHJKL;'?\n*ZXCVBNM,./*" {||\1 ||}]]] _ f set h [string map {\\ _ / _ | \ } [set g [string map {||_ |/_ _|| _\\|} [string map {||| \\|/} $f]]]] foreach j {h b f g} { set $j "[split [set $j] \n]" } foreach x $h y $b z $f w $g {puts "$x\n$y\n$z\n$w" }
Snippet to print info vars' contents:
lmap c [info vars] { if {[array exists $c]} { puts \n\n$c parray $c } else { puts $c:\ [set $c] } }
ak - 2017-05-03 17:02:48For curiosity, why lmap instead of foreach ? Here lmap collects
[llength [info vars]]empty strings into a list which is then discarded. Because the puts and parray print to stdout, and havbe an empty string as return value. foreach OTOH will collect nothing, saving the bits of memory.
Because I usually do Code-golf using Tcl, where it matters how much I can shrink the source code. lmap has a lesser extent than foreach in the code. You can see my activity on https://codegolf.stackexchange.com/users/29325/sergiol where almost all answers I posted used Tcl.
ak - 2017-05-08 20:17:09I see, optimization for code-size, whereas I looked for / optimized for performance, in broadest strokes. Valid points each. Thank you.
sergiol - 2017-12-12 01:46I think I discovered how to fix the problem of -outlinestipple not working for rectangle and ovals when creating them on Windows. The fix was done on version 8.6.7: tkWinDraw.cAs it will be very first contribution on the Tcl/Tk own's source code, I am not so sure and I would like to ask for code review!