Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
also minos
|
||||
text-label ptr click-label
|
||||
Variable click# click# off
|
||||
: click-win ( -- ) screen self window new window with
|
||||
X" There have been no clicks yet" text-label new
|
||||
dup F bind click-label
|
||||
^ S[ 1 click# +!
|
||||
click# @ 0 <# #S s" Number of clicks: " holds #>
|
||||
click-label assign ]S X" Click me" button new
|
||||
&2 vabox new panel s" Clicks" assign show endwith ;
|
||||
click-win
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
#! xbigforth
|
||||
\ automatic generated code
|
||||
\ do not edit
|
||||
|
||||
also editor also minos also forth
|
||||
|
||||
component class ccount
|
||||
public:
|
||||
early widget
|
||||
early open
|
||||
early dialog
|
||||
early open-app
|
||||
text-label ptr click#
|
||||
( [varstart] ) cell var clicks ( [varend] )
|
||||
how:
|
||||
: open new DF[ 0 ]DF s" Click counter" open-component ;
|
||||
: dialog new DF[ 0 ]DF s" Click counter" open-dialog ;
|
||||
: open-app new DF[ 0 ]DF s" Click counter" open-application ;
|
||||
class;
|
||||
|
||||
ccount implements
|
||||
( [methodstart] ) ( [methodend] )
|
||||
: widget ( [dumpstart] )
|
||||
X" There have been no clicks yet" text-label new ^^bind click#
|
||||
^^ S[ 1 clicks +!
|
||||
clicks @ 0 <# #S s" Number of clicks: " holds #> click# assign ]S ( MINOS ) X" Click me" button new
|
||||
&2 vabox new panel
|
||||
( [dumpend] ) ;
|
||||
: init ^>^^ assign widget 1 :: init ;
|
||||
class;
|
||||
|
||||
: main
|
||||
ccount open-app
|
||||
$1 0 ?DO stop LOOP bye ;
|
||||
script? [IF] main [THEN]
|
||||
previous previous previous
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
0 value tk-in
|
||||
0 value tk-out
|
||||
variable #clicks
|
||||
0 #clicks !
|
||||
|
||||
: wish{ \ send command to wish
|
||||
tk-in to outfile-id ;
|
||||
: }wish \ finish command to wish
|
||||
tk-in flush-file throw
|
||||
stdout to outfile-id ;
|
||||
|
||||
|
||||
: add-one 1 #clicks +! ;
|
||||
: update-wish wish{ .\" .label configure -text \"clicks: " #clicks @ . .\" \"" cr }wish ;
|
||||
|
||||
: counting
|
||||
begin
|
||||
tk-out key-file
|
||||
dup '+' = if add-one update-wish then \ add one if '+' received
|
||||
4 = until ; \ until Ctrl-D, wish exit
|
||||
|
||||
: initiating
|
||||
s" mkfifo tk-in tk-out" system
|
||||
s" wish <tk-in >tk-out &" system
|
||||
s" tk-in" w/o open-file throw to tk-in
|
||||
s" tk-out" r/o open-file throw to tk-out
|
||||
wish{ .\" pack [ label .label -text \"There have been no clicks yet\" ] " cr }wish
|
||||
wish{ .\" pack [ button .click -text \"Click Me\" -command { puts \"+\" } ] " cr }wish ;
|
||||
|
||||
: cleaning
|
||||
tk-in close-file
|
||||
tk-out close-file
|
||||
s" rm tk-in tk-out" system ;
|
||||
|
||||
initiating counting cleaning
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
:class TextView' super{ TextView }
|
||||
:m put: ( addr len -- )
|
||||
0 #ofChars: self SetSelect: self
|
||||
insert: self ;m
|
||||
;class
|
||||
|
||||
Window+ w
|
||||
View wview
|
||||
Button b
|
||||
100 30 100 20 setFrame: b
|
||||
TextView' t
|
||||
200 30 200 15 setFrame: t
|
||||
|
||||
\ the running count is always on the stack
|
||||
\ so a variable for that is not needed
|
||||
:noname
|
||||
1+ \ increment the count
|
||||
" Number of clicks: " put: t
|
||||
dup deciNumstr insert: t ; setAction: b \ update the text representation of count
|
||||
|
||||
: go
|
||||
b addview: wview
|
||||
t addview: wview
|
||||
300 30 430 230 put: frameRect
|
||||
frameRect " Test" docWindow
|
||||
wview new: w show: w
|
||||
" click me" setTitle: b
|
||||
" There have been no clicks yet" put: t
|
||||
0 ; \ the number of clicks start at zero
|
||||
|
||||
go
|
||||
Loading…
Add table
Add a link
Reference in a new issue