it's lives, but I'm still a little confused on how I set where it sits in the layout, and how to make it dragable - the class is not enough. I appreciate the help - I'm having a bad run at making sense of the documentation.<br>
<br>the relevant bit; <br>[...]<br> (define (tabs-mixin super%)<br> (class super%<br> (define text (new text%))<br> (super-new)<br> (let* ((area-container (send this get-area-container))<br> (test-panel (new panel:horizontal-dragable% (parent area-container)))<br>
(text (new text%))<br> (ed (new editor-canvas% (parent test-panel))))<br> (send ed set-editor text)<br> #;(send area-container add-child test-panel)) ;;; I need a parent to instantiate a panel.<br>
)) <br>[...]<br><br>As you can see I'm also curious about the nature of the add-child method, given that the panel is added at instantiation, and a parent is required.<br><br>Thanks again for your help.<br>, <br>
Stephen<br><br>Full file; <br><br>#lang racket/base<br>(require mred<br> racket/class<br> scheme/file<br> scheme/contract<br> framework/framework<br> framework<br> racket/unit<br>
drracket/tool-lib<br> drscheme/tool<br> )<br><br>(provide tool@)<br><br>(define tool@<br> (unit<br> (import drracket:tool^)<br> (export drracket:tool-exports^)<br> (define (phase1) (void))<br>
(define (phase2) (void))<br> <br>(define (tabs-mixin super%)<br> (class super%<br> ; frame:basic<%> <br> ; frame:basic-mixin: do not add children directly to a frame:basic (unless using make-root-area-container)<br>
; use the get-area-contaner method instead<br> (define text (new text%))<br> <br> (inherit get-current-tab get-menu-bar get-button-panel register-toolbar-button)<br> (super-new)<br> <br>
(let* ((area-container (send this get-area-container))<br> (test-panel (new panel:horizontal-dragable% (parent area-container)))<br> (text (new text%))<br> (ed (new editor-canvas% (parent test-panel))))<br>
(send ed set-editor text)<br> #;(send area-container add-child test-panel))<br> ))<br> <br> <br> (drracket:get/extend:extend-unit-frame tabs-mixin)<br> ))<br><br>;; info file<br>#lang setup/infotab<br>
<br>(define name "Cosmonaut")<br>(define version "0.1")<br>(define release-notes '("for Racket 5"))<br>(define blurb '("Cosmonaut lets you explore the PLaneT package repository from within DrScheme."))<br>
<br>(define doc.txt "doc.txt")<br>(define homepage "<a href="http://sp.degabrielle.name/cosmonaut">http://sp.degabrielle.name/cosmonaut</a>")<br><br><br>(define drracket-tools '(("cosmonaut.rkt") <br>
;("fossil.rkt") <br> ;("tabs.rkt")<br> ))<br><br>(define drracket-tool-names '("Cosmonaut"<br> ;"Fossil"<br>
;"Tabs"<br> ))<br><br>;(define drracket-tool-icons (list (list "cosmonaut.png" "fossil.png" "projectmgr.png")))<br>(define drracket-tool-urls '(("<a href="http://sp.degabrielle.name/cosmonaut">http://sp.degabrielle.name/cosmonaut</a>")<br>
;("<a href="http://sp.degabrielle.name/Fossil">http://sp.degabrielle.name/Fossil</a>")<br> ;("<a href="http://sp.degabrielle.name/Tabs">http://sp.degabrielle.name/Tabs</a>")<br>
))<br><br><br><br><br><br><br><br><br><br>On Wed, Jun 30, 2010 at 5:02 PM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">You want to create a tool, add in a frame-mixin (both via the tools<br>
interface), and then use the frame:basic<%> mechanism for adding<br>
panels to the frame.<br>
<br>
If that's not enough to get you started, I'll write up a little<br>
example tool that does it.<br>
<br>
Robby<br>
<div><div></div><div class="h5"><br>
On Wed, Jun 30, 2010 at 8:30 AM, Stephen De Gabrielle<br>
<<a href="mailto:spdegabrielle@gmail.com">spdegabrielle@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> Please forgive my ignorance, I'm trying to work out how to add a panel<br>
> (like program contour) to DrRacket.<br>
><br>
> Does anyone know the correct method, or can point me to source code, or the<br>
> right bit of the documentation?<br>
><br>
> Cheers,<br>
><br>
> Stephen<br>
><br>
</div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br><br>--<br>Stephen De Gabrielle<br><a href="mailto:stephen.degabrielle@acm.org">stephen.degabrielle@acm.org</a><br>Telephone +44 (0)20 85670911<br>Mobile +44 (0)79 85189045<br>
<a href="http://www.degabrielle.name/stephen">http://www.degabrielle.name/stephen</a><br><br>