Hi,

>From the Help Desk:
(new tab-panel%
    [choices choices]
[...]

 → (is-a?/c tab-panel%)
  choices : (listof label-string?)

So it wants a list of label-string.
Then clicking on `label-string?` gives:

"""
(label-string? v) → boolean?

  v : any/c
Returns #t if v is a string whose length is less than or equal to 200.

This predicate is typically used as the contract for strings that appear in
GUI objects. In some cases, such as the label in a button% or menu-item%
object, the character & is treated specially to indicate that the following
character is used in keyboard navigation. See set-label in
labelled-menu-item<%> for one such example. In other cases, such as the
label on a frame%, & is not treated specially.
"""

So you could do the following:

(define tab-panel (new tab-panel%
                       (parent dialog)
                       (choices (map ~a (vector->list Vec)))))

Laurent

On Thu, Dec 20, 2012 at 12:19 PM, <herak...@gmx.de> wrote:

> Hello friends,
>
> how can I convert a vector  (define Vec #(1 2 3 4))
>
> to a label-string to make a tab-panel??
>
> I try this
> (define tab-panel (new tab-panel%
>                        (parent dialog)
>                        (choices (vector->list Vec))))
>
> but it fails due to contract violation: expected: label-string?
>
> So what ist a label-string???
>
>
> Yours,
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to