I've got it working, by looking at the example 'delegate-mixin' in <br>framework/private/frame.rkt<br><br>Thanks for you tips. I'll soon work out *how* it works and post a mini-example.<br><br>Cheers, <br><br>
Stephen<br><br><br><div class="gmail_quote">On Fri, Jul 2, 2010 at 12:22 PM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span> wrote:<br><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 override the make-root-area-container method to create<br>
your panel. See here:<br>
<br>
<a href="http://docs.racket-lang.org/framework/Frame.html?q=frame%3Abasic#%28meth._%28%28%28lib._framework/main..rkt%29._frame%7E3abasic%7E3c%7E25%7E3e%29._make-root-area-container%29%29" target="_blank">http://docs.racket-lang.org/framework/Frame.html?q=frame%3Abasic#%28meth._%28%28%28lib._framework/main..rkt%29._frame~3abasic~3c~25~3e%29._make-root-area-container%29%29</a><br>
<br>
(and ask again if that's not enough of a hint; sorry for the clue<br>
dropping, I promise that eventually I make a little example if you<br>
don't beat me to it.)<br>
<br>
Robby<br>
<br>
On Thu, Jul 1, 2010 at 9:42 AM, Stephen De Gabrielle<br>
<div><div></div><div class="h5"><<a href="mailto:spdegabrielle@gmail.com">spdegabrielle@gmail.com</a>> wrote:<br>
> it's lives, but I'm still a little confused on how I set where it sits in<br>
> the layout, and how to make it dragable - the class is not enough. I<br>
> appreciate the help - I'm having a bad run at making sense of the<br>
> 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<br>
> 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<br>
> to instantiate a panel.<br>
> ))<br>
> [...]<br>
><br>
> As you can see I'm also curious about the nature of the add-child method,<br>
> 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<br>
> (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<br>
> register-toolbar-button)<br>
> (super-new)<br>
><br>
> (let* ((area-container (send this get-area-container))<br>
> (test-panel (new panel:horizontal-dragable% (parent<br>
> 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<br>
> from within DrScheme."))<br>
><br>
> (define doc.txt "doc.txt")<br>
> (define homepage "<a href="http://sp.degabrielle.name/cosmonaut" target="_blank">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"<br>
> "projectmgr.png")))<br>
> (define drracket-tool-urls '(("<a href="http://sp.degabrielle.name/cosmonaut" target="_blank">http://sp.degabrielle.name/cosmonaut</a>")<br>
> ;("<a href="http://sp.degabrielle.name/Fossil" target="_blank">http://sp.degabrielle.name/Fossil</a>")<br>
> ;("<a href="http://sp.degabrielle.name/Tabs" target="_blank">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 <<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>><br>
> wrote:<br>
>><br>
>> 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>
>><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<br>
>> > the<br>
>> > right bit of the documentation?<br>
>> ><br>
>> > Cheers,<br>
>> ><br>
>> > Stephen<br>
>> ><br>
>> > _________________________________________________<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>
><br>
><br>
><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" target="_blank">http://www.degabrielle.name/stephen</a><br>
><br>
><br>
</div></div></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>