You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
805 B
Racket
17 lines
805 B
Racket
8 years ago
|
#lang br
|
||
|
(require racket/draw)
|
||
8 years ago
|
(provide make-jsonic-buttons)
|
||
8 years ago
|
|
||
8 years ago
|
(define make-jsonic-buttons
|
||
8 years ago
|
(list (let ([label "Insert expression"]
|
||
|
[bitmap (make-object bitmap% 16 16)]
|
||
|
[callback (λ (drr-frame)
|
||
|
(define drr-editor (send drr-frame get-definitions-text))
|
||
8 years ago
|
(define block-string "@$ $@")
|
||
8 years ago
|
(send drr-editor begin-edit-sequence)
|
||
8 years ago
|
(send drr-editor insert block-string)
|
||
8 years ago
|
(send drr-editor end-edit-sequence)
|
||
|
(define pos (send drr-editor get-end-position))
|
||
8 years ago
|
(send drr-editor set-position (- pos (/ (string-length block-string) 2))))]
|
||
8 years ago
|
[number 98])
|
||
|
(list label bitmap callback number))))
|