<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 21, 2012 at 10:59 AM, <span dir="ltr"><<a href="mailto:heraklea@gmx.de" target="_blank">heraklea@gmx.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ahhhh,<br>
ok thank you very much. By the way, when I make a tab-panel with multiple tabs and add a list-box to the tab-panel it appears on all tab pages. So how can I specify the tab/tabindex as parent to the list-box?<br></blockquote>
<div><br></div><div>You need to change the children of the tab-panel when the user changes the tab. There have been examples of this on the mailing list, so you may search it for "tab-panel" probably. <br><br></div>
<div>Since it's not very obvious how to do it, here is a working example:<br><a href="http://pastebin.com/2C920yW9">http://pastebin.com/2C920yW9</a><br></div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
And is it possible to init the list-box with more choices as one. In the example in the doc there is a initialisation only for one column. I would like to init say 4 columns with data(as vector or map??).<br>
For this I don´t found any example, and I hope you could give me the place where it stays or an suggestion..<br></blockquote><div><br></div><div>Apparently, you can't use the constructor to initialize theother columns, but you can still do it with `set':<br>
<br><div style="margin-left:40px">(send a-list-box set choices ...) → void?<br><br> choices : (listof label-string?)<br>Clears the list box and installs a new list of items. The number of choices lists must match the number of columns, and all choices lists must have the same number of items, otherwise an exn:fail:contract exception is raised.<br>
</div></div><div> <br></div><div>Cheers,<br></div><div>Laurent<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Yours,<br>
<br>
-------- Original-Nachricht --------<br>
> Datum: Thu, 20 Dec 2012 12:44:52 +0100<br>
> Von: Laurent <<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>><br>
> An: murat demirtas <<a href="mailto:heraklea@gmx.de" target="_blank">heraklea@gmx.de</a>><br>
> CC: racket <<a href="mailto:users@racket-lang.org" target="_blank">users@racket-lang.org</a>><br>
> Betreff: Re: [racket] label-string<br>
<div><div><br>
> Hi,<br>
><br>
> From the Help Desk:<br>
> (new tab-panel%<br>
> [choices choices]<br>
> [...]<br>
><br>
> → (is-a?/c tab-panel%)<br>
> choices : (listof label-string?)<br>
><br>
> So it wants a list of label-string.<br>
> Then clicking on `label-string?` gives:<br>
><br>
> """<br>
> (label-string? v) → boolean?<br>
><br>
> v : any/c<br>
> Returns #t if v is a string whose length is less than or equal to 200.<br>
><br>
> This predicate is typically used as the contract for strings that appear<br>
> in<br>
> GUI objects. In some cases, such as the label in a button% or menu-item%<br>
> object, the character & is treated specially to indicate that the<br>
> following<br>
> character is used in keyboard navigation. See set-label in<br>
> labelled-menu-item<%> for one such example. In other cases, such as the<br>
> label on a frame%, & is not treated specially.<br>
> """<br>
><br>
> So you could do the following:<br>
><br>
> (define tab-panel (new tab-panel%<br>
> (parent dialog)<br>
> (choices (map ~a (vector->list Vec)))))<br>
><br>
> Laurent<br>
><br>
> On Thu, Dec 20, 2012 at 12:19 PM, <<a href="mailto:heraklea@gmx.de" target="_blank">heraklea@gmx.de</a>> wrote:<br>
><br>
> > Hello friends,<br>
> ><br>
> > how can I convert a vector (define Vec #(1 2 3 4))<br>
> ><br>
> > to a label-string to make a tab-panel??<br>
> ><br>
> > I try this<br>
> > (define tab-panel (new tab-panel%<br>
> > (parent dialog)<br>
> > (choices (vector->list Vec))))<br>
> ><br>
> > but it fails due to contract violation: expected: label-string?<br>
> ><br>
> > So what ist a label-string???<br>
> ><br>
> ><br>
> > Yours,<br>
> > ____________________<br>
> > Racket Users list:<br>
> > <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
> ><br>
</div></div></blockquote></div><br></div></div>