SP graphics gets a type theory

157 views
Skip to first unread message

Mark Tarver

unread,
Apr 23, 2017, 5:49:21 AM4/23/17
to Shen
A bit of a pause on the Ring to add a new plugin.  

The widget set in SP is getting its own type theory as a plugin.  This is a fairly long term project which I'll top up as time goes on.  The reason for this is that the Tk widget spec - options included - is absolutely huge.  

The SP version considerably rationalises using this spec; still a full type theory will probably incorporate several hundred rules.  

I'll reserve this thread for developments on this.

Mark

Mark Tarver

unread,
Apr 30, 2017, 9:17:30 AM4/30/17
to Shen
OK; this plugin is up now.  Help will be made available on the graphics web page.  About 2-3 days.

Mark

Mark Tarver

unread,
May 1, 2017, 3:52:50 AM5/1/17
to Shen
Some of the updates are now documented.


Mark

Mark Tarver

unread,
May 1, 2017, 9:22:10 AM5/1/17
to Shen
Looks as if I've found a fast way round giving Tk stuff types; the program is complete - covers about 75% of Tk (barring exotic stuff).  Will document soon.

Mark

Mark Tarver

unread,
May 1, 2017, 7:22:08 PM5/1/17
to Shen
Will be a bit unstable over the next 48 hours as I work on it.  Should be good soon.

Mark

Mark Tarver

unread,
May 2, 2017, 4:45:13 AM5/2/17
to qil...@googlegroups.com
Upgraded it; checkboxes do not type check - neither frames - I'll look into this.

Definitely getting there.

Mark

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+unsubscribe@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.
Visit this group at https://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.

Mark Tarver

unread,
May 2, 2017, 5:06:09 AM5/2/17
to Shen
All the following type checks under the Tk types plugin.

Code from the help page.  You can see the expected graphics on the same page.

Mark

(widget .mywin window)
(widget .mywin.b1 button)
(widget .mywin.b2 button -text "Button 2")
(widget .mywin.b3 button -text "Button 3" -background "green")
(widget .mywin.b4 button -text "Button 4" -foreground "blue")
(widget .mywin.b5 button -text "Button 5" -font "Impact")
(widget .mywin.b6 button -text "Button 6" -relief sunken)
(widget .mywin.b7 button -text "Button 7" -highlightthickness 10)
(widget .mywin.b8 button -text "Button 8" -underline 6)
(widget .mywin.b9 button -text "Button 9" -padx 30 -pady 10)
(widget .mywin.b10 button 
        -text "A very long line of text for a button"
        -justify right 
        -wraplength 50)
(widget .mywin.b11 button  
        -text "A very long line of text for a button"   
        -justify left 
        -wraplength 50)
(widget .mywin.b12 button   
        -text "A very long line of text for a button"  
        -justify center 
        -wraplength 50)

(pack [.mywin.b1 .mywin.b2 .mywin.b3 .mywin.b4 .mywin.b5 .mywin.b6 
       .mywin.b7 .mywin.b8 .mywin.b9 .mywin.b10 .mywin.b11 .mywin.b12])

(widget .mydb window)
(widget .mydb.name label -text "Name")
(widget .mydb.street label -text "Street Number")
(widget .mydb.city label -text "City")
(widget .mydb.state label -text "State/County")
(widget .mydb.country label -text "Country")

(widget  .mydb.namee entry -width 20)
(widget  .mydb.streete entry -width 20)
(widget  .mydb.citye entry -width 20)
(widget  .mydb.statee entry -width 20)
(widget  .mydb.countrye entry -width 20)
(analog-grid [[.mydb.name  .mydb.namee]
             [.mydb.street .mydb.streete]
             [.mydb.city .mydb.citye]
             [.mydb.state .mydb.statee]
             [.mydb.country .mydb.countrye]]
             -padx 10 -pady 10)

Mark Tarver

unread,
May 2, 2017, 6:25:25 AM5/2/17
to qil...@googlegroups.com
All the following help examples work; screen shot below.

Mark   

Shen, copyright (C) 2010-2017 Mark Tarver
www.shenlanguage.org, Shen Professional Edition 17
running under Common Lisp, implementation: SBCL
port 2.1 ported by Mark Tarver
home licensed to Mark Tarver

(0-) downloading plugin ... please wait
plugin downloaded

(0+).mywin : window
.mywin.b1 : button
.mywin.b2 : button
.mywin.b3 : button
.mywin.b4 : button
.mywin.b5 : button
.mywin.b6 : button
.mywin.b7 : button
.mywin.b8 : button
.mywin.b9 : button
.mywin.b10 : button
.mywin.b11 : button
.mywin.b12 : button
[.mywin.b1 .mywin.b2 .mywin.b3 .mywin.b4 .mywin.b5 .mywin.b6 .mywin.b7 .mywin.b8
 .mywin.b9 .mywin.b10 .mywin.b11 .mywin.b12] : (list widget)
.mydb : window
.mydb.name : label
.mydb.street : label
.mydb.city : label
.mydb.state : label
.mydb.country : label
.mydb.namee : entry
.mydb.streete : entry
.mydb.citye : entry
.mydb.statee : entry
.mydb.countrye : entry
[[.mydb.name .mydb.namee] [.mydb.street .mydb.streete] [.mydb.city .mydb.citye]
[.mydb.state .mydb.statee] [.mydb.country .mydb.countrye]] : (list (list symbol)
)
.mychk : window
type#globals : symbol
false : boolean
false : boolean
false : boolean
toggle : (symbol --> boolean)
.mychk.cb1 : checkbutton
.mychk.cb2 : checkbutton
.mychk.cb3 : checkbutton
[.mychk.cb1 .mychk.cb2 .mychk.cb3] : (list widget)
.myrad : window
.myrad.rb1 : radiobutton
.myrad.rb2 : radiobutton
.myrad.rb3 : radiobutton
[.myrad.rb1 .myrad.rb2 .myrad.rb3] : (list widget)
.paint : window
.paint.canvas : canvas
[.paint.canvas] : (list widget)
[] : (list A)
.mypack : window
.mypack.b1 : button
.mypack.b2 : button
.mypack.b3 : button
.mypack.b4 : button
.mypack.b5 : button
[.mypack.b1 .mypack.b2 .mypack.b3 .mypack.b4 .mypack.b5] : (list widget)
.mypack2 : window
.mypack2.b1 : button
.mypack2.b2 : button
.mypack2.b3 : button
.mypack2.b4 : button
.mypack2.b5 : button
[.mypack2.b1 .mypack2.b2 .mypack2.b3 .mypack2.b4 .mypack2.b5] : (list widget)
.mypack3 : window
.mypack3.b1 : button
.mypack3.b2 : button
.mypack3.b3 : button
.mypack3.b4 : button
.mypack3.b5 : button
[.mypack3.b1 .mypack3.b2 .mypack3.b3 .mypack3.b4 .mypack3.b5] : (list widget)
[.mypack3.b1 .mypack3.b2 .mypack3.b3 .mypack3.b4 .mypack3.b5] : (list widget)
.myframe : window
.myframe.f1 : frame
.myframe.f2 : frame
.myframe.f1.b1 : button
.myframe.f1.b2 : button
.myframe.f2.b3 : button
.myframe.f2.b4 : button
[.myframe.f1.b1 .myframe.f1.b2] : (list widget)
[.myframe.f1.b1 .myframe.f1.b2] : (list widget)
[.myframe.f2.b3 .myframe.f2.b4] : (list widget)
[.myframe.f1 .myframe.f2] : (list widget)
run time: 0.07800006866455078 secs

typechecked in 7937 inferences
loaded

(0+)


Inline image 1

Chris Double

unread,
May 2, 2017, 8:39:51 AM5/2/17
to qil...@googlegroups.com
On Tue, May 2, 2017 at 10:25 PM, Mark Tarver <dr.mt...@gmail.com> wrote:
>
> All the following help examples work; screen shot below.

Looks great!

--
http://bluishcoder.co.nz

Mark Tarver

unread,
May 2, 2017, 6:29:30 PM5/2/17
to Shen, chris....@double.co.nz
Thanks for that; the revised program is now available as a plugin.  I've made some minor tweaks - spelling 'colour' as 'color' to keep in with TCL/Tk conventions.  Due to an insight we'll be able to absorb a lot of TCL/tk very quickly into sequent calculus.   It is not going to be the vast project I feared given the massive length of the Tk documentation.  It will still take time, but not geological time.

The help for the system was updated today http://www.shenlanguage.org/Professional/Help/Graphics/ for reference.

The test file is attached for those who want to use it.  It worked under Windows; should work under Linux too - I hope!  It will simply spew hordes of windows over your desktop and is designed to test program features.  But it will educate hopefully.

Mark
test.shen

Mark Tarver

unread,
May 2, 2017, 6:47:13 PM5/2/17
to qil...@googlegroups.com
The Tk Types plugin recognises the types of Tk colours in RGB values as well as the English for 755 colours.  Plus 131 font families and 76 cursor choices.  Have a psychedelic night!  I'm off to sleep here.

Mark

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+unsubscribe@googlegroups.com.

Mark Tarver

unread,
May 3, 2017, 6:29:26 AM5/3/17
to Shen

Mark Tarver

unread,
May 4, 2017, 3:31:22 AM5/4/17
to Shen
I've upgraded this to add type secure support for text boxes - entries for multi line areas of text - yesterday.  The help page has not been updated yet.

Mark

Mark Tarver

unread,
May 4, 2017, 5:55:03 PM5/4/17
to Shen
I've upgraded the documentation to include text boxes.  



That's it - just for the time being wrt to things that blink colours and go bong.  All good stuff as my chemistry master used to say.  I quite enjoyed it as a break from computational logic.  There's a raft of stuff about key bindings in Tk etc. which I need to assimilate.  

Mark
Reply all
Reply to author
Forward
0 new messages