I have created something working, but I struggled quite a bit with it. This is what I've got:
#lang racket
(require racket/gui/base)
(define startmenu (new frame%
(label "Test")
(min-width 640)
(stretchable-width #f)))
(define (change-tab tab-panel event)
(let ((index (send tab-panel get-selection)))
(send tab-panel
change-children
(lambda (children)
(list (vector-ref tabs index))))))
(define tab-labels (list " Singleplayer "
" Multiplayer "
" Settings "))
(define tab-panel (new tab-panel%
(parent startmenu)
(vert-margin 8)
(horiz-margin 8)
(callback change-tab)
(choices tab-labels)))
(define tabs (vector-map (lambda (label)
(new vertical-panel%
(parent tab-panel)
(spacing 4)
(vert-margin 8)
(horiz-margin 8)
(alignment '(left top))))
(list->vector tab-labels)))
(define player-side (new choice%
(parent (vector-ref tabs 0))
(label "Side: ")
(choices (list "Blue" "Red"))))
(define play-button (new button%
(parent (vector-ref tabs 0))
(label " Play Tutorial ")))
(define address (new text-field%
(parent (vector-ref tabs 1))
(label "Address: ")))
(define connect-button (new button%
(parent (vector-ref tabs 1))
(label " Connect ")))
(define fullscreen (new check-box%
(parent (vector-ref tabs 2))
(label " Fullscreen")))
(define v-sync (new check-box%
(parent (vector-ref tabs 2))
(label " V-Sync")))
(module+ main
(send tab-panel
change-children
(lambda (children)
(list (vector-ref tabs 0))))
(send startmenu show #t))
Is this (roughly) how the tab-panel is supposed to be used? Or am I doing something braindead here?
Especially the change-children method with it's filter function argument I found confusing. I'm not sure if I've ever seen an application were upon the selection of a tab did not the entire content area change. Why would I ever want to filter the children?
Also note the call to change-children in the main module. Without it, all widgets would be rendered initially in the "Singleplayer" tab.
Thus my question: am I demonstrating a profound misunderstanding of how the tab-panel is supposed to be used?