editor-canvas% questions

20 views
Skip to first unread message

Emma Borhanian

unread,
Apr 21, 2020, 5:41:17 AM4/21/20
to Racket Users
Hi if I have a simple editor-canvas% with text% in it:
(define editor-canvas (new  editor-canvas% [parent frame]))
(define text (new text%))
(send editor-canvas set-editor text)

1. How do I make the standard right click menu with copy, paste, etc.?

But is there some shorthand for making the standard copy/paste popup?

2. I can add "Edit" and "Font" to the menu bar like this:
(define mb (new menu-bar% [parent frame]))
(define m-edit (new menu% [label "Edit"] [parent mb]))
(define m-font (new menu% [label "Font"] [parent mb]))
(append-editor-operation-menu-items m-edit #f)
(append-editor-font-menu-items m-font)

In Mac OS this isn't leading to the menu bar flashing blue when I use keyboard shortcuts like ⌘c. How can I fix this? I notice DrRacket itself has the same bug. This is important for discoverability.

3. How do I do a bulleted list? Should I be using this snip in the browser lib? https://github.com/racket/drracket/blob/master/drracket/browser/private/bullet.rkt
Reply all
Reply to author
Forward
0 new messages