
Is it possible for a plugin to add a bar like the search bar or check syntax bar?

Untested: It might even be possible with quickscript, since it has access to the frame if you add the #:frame fr
in the lambda args, and then use change-children
on the frame Quickscript can at least add a menu (tested).

In last recourse you can always make a floating frame that’s always on top

No need for change-children
for something simple: #lang racket/gui
(require quickscript)
(define-script add-frame-child
#:label "add-frame-child"
(λ (selection #:frame fr)
(define cont (send fr get-area-container))
(new button% [parent cont] [label "Press me"]
[callback
(λ (bt ev)
(message-box "Slight annoyance" "The internet has disappeared.")
;; Remove the button
(send cont delete-child bt))])
#f))

Note that if you make your script #:persistent
you can define globals in your script file that will persist from one call of the script to the next

I have to say writing quickscript is an absolute joy. No need to reload DrRacket. It Just Works™.

I updated the script above to remove the button after pressing it.

Initially I tried the previous script several times so there were many buttons in DrRacket. I modified the script to remove all buttons but… instead I kept all buttons, removing the editors :sweat_smile: (I still didn’t have to fully restart DrRacket per se, I just opened a new window and closed the other)

remove-child
also works

No need to use the full change-children

delete-child
you mean? Yeah, but once the script has finished, I didn’t have the handle anymore, so needed to filter

(though it can be used in the script directly, i’ll change that)

Yet another question

I need something from drracket/tool-lib

But it looks like require
-ing it will instantiate a new DrRacket instance

which results in an error like:
initialization for menu-bar%: given parent already has a menu bar
given: 'root

How can I successfully require drracket/tool-lib
?

What do you need from tool-lib?


Context: there’s this line in org.racket-lang.prefs.rktd
:
(plt:framework-pref:drracket:language-settings ((-32768) (#6(#t print mixed-fraction-e #f #t debug) (default) #3("foo" "bar" "baz") #f #t #f ((test) (main)) #t)))

I want to extract information from it. Of course, I could just read it and search it myself, but using preference:get
looks like the intended way to do it.

Here’s an example of what I want to do: https://github.com/racket/drracket/blob/master/drracket/drracket/private/help-desk.rkt#L25

I’m not sure I guess the only way to do it properly is for quickscript to expose these structs, though I’m not sure.

At least you can still get some info ‘manually’: > (require framework)
> (preferences:set-default 'drracket:language-settings
#f
(λ (x) #t))
> (preferences:get 'drracket:language-settings)
((-32768)
(#(#t trad-write mixed-fraction-e #f #t debug)
(default)
#()
"#lang racket\n"
#t
#t
((test) (drracket))
#t))

If you define the struct yourself, and map the result above to the struct, you can do ‘as if’

This will do it for now, thanks!

If you use the code above for writing to the prefs, you’ll need a better checker inset-default