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