Skip to content

Instantly share code, notes, and snippets.

@LeifAndersen
Created November 24, 2018 21:02
Show Gist options
  • Select an option

  • Save LeifAndersen/4c8816574f5a777a1c4e85aa6cb96d03 to your computer and use it in GitHub Desktop.

Select an option

Save LeifAndersen/4c8816574f5a777a1c4e85aa6cb96d03 to your computer and use it in GitHub Desktop.
#lang at-exp racket/unit
(require framework
drracket/tool
racket/gui
racket/port
racket/format
racket/class)
(import drracket:tool^)
(export drracket:tool-exports^)
(define (frame-mixin super%)
(class super%
(define the-panel-parent #f)
(define the-panel #f)
(define d/i-p-p #f)
(super-new)
(define/override (get-definitions/interactions-panel-parent)
(unless the-panel-parent
(set! the-panel-parent (new panel:vertical-dragable%
[parent (super get-definitions/interactions-panel-parent)]))
(set! the-panel (new vertical-panel% [parent the-panel-parent]
[style '(border)]
[stretchable-width #f]
[stretchable-height #f]))
(send the-panel-parent change-children (λ (l) '()))
(define button
(new button% [parent the-panel]
[label "HI"]
[callback (λ (b e) (hide-panel))]))
(set! d/i-p-p (make-object vertical-panel% the-panel-parent)))
d/i-p-p)
(define/public (show-panel)
(send the-panel-parent change-children (λ (l) (cons the-panel l)))
(send the-panel-parent set-percentages
'(1/10 9/10)))
(define/public (hide-panel)
(send the-panel-parent change-children (λ (l) (rest l))))
(show-panel)))
(define (phase1) (void))
(define (phase2) (void))
;(drracket:get/extend:extend-definitions-text def-mixin)
(drracket:get/extend:extend-unit-frame frame-mixin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment