Skip to content

Commit 583f9cf

Browse files
author
wood
committed
calc.ss
1 parent 4901507 commit 583f9cf

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

apps/calc.ss

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,16 @@
5353
(imgui-text (format "exp: ~A" exp))
5454
(imgui-separator)
5555

56-
(if (imgui-button "C" (imgui-make-vec2 40.0 40.0) )
57-
((set! exp "") (set! exp2 ""))
58-
)
59-
(imgui-same-line)
60-
(if (imgui-button "+/-" (imgui-make-vec2 40.0 40.0) )
61-
(set! exp (string-append exp " + "))
56+
(if (imgui-button "C" (imgui-make-vec2 88.0 40.0) )
57+
(set! exp "")
6258
)
59+
;;(imgui-same-line)
60+
;;(if (imgui-button "+/-" (imgui-make-vec2 80.0 40.0) )
61+
;; (set! exp (string-append exp " + "))
62+
;; )
6363
(imgui-same-line)
6464
(if (imgui-button "%" (imgui-make-vec2 40.0 40.0) )
65-
((set! exp (string-append exp " % "))
66-
(set! exp2 (string-append exp2 " remainder "))))
65+
(set! exp (string-append exp " % ")))
6766
(imgui-same-line)
6867
(if (imgui-button "÷" (imgui-make-vec2 40.0 40.0) )
6968
(set! exp (string-append exp " / ")))
@@ -128,11 +127,10 @@
128127
(imgui-same-line)
129128
(if (imgui-button "=" (imgui-make-vec2 40.0 40.0) )
130129
;;(glut-log (infix-prefix (read (open-input-string exp))))
131-
(set! exp (string-append exp (format " = ~a"
132-
(eval
133-
(infix-prefix
134-
(read (open-input-string
135-
(string-append (string-append "(" exp) ")"))))))))
130+
(set! exp (string-append exp (format " = ~a" (eval
131+
(infix-prefix
132+
(read (open-input-string
133+
(string-append (string-append "(" exp) ")"))))))))
136134
)
137135

138136
(imgui-end)

bin/imgui.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ Collapsed=0
1515

1616
[calculator]
1717
Pos=60,60
18-
Size=210,230
18+
Size=360,311
1919
Collapsed=0
2020

0 commit comments

Comments
 (0)