[plt-scheme] Dragable panels

From: Ivanyi Peter (pivanyi at freemail.hu)
Date: Wed Jan 5 06:36:51 EST 2005


I have some problems with the dragable panels from framework. 
I am working in DrScheme v208. I have included a little code
hopefully demonstrates the problem. In the code there is a
line. If I uncomment it, then DrScheme always reports that
"the percentages would violate minimum size requirements of
the children". I did not manage to specify any valid value,
not even half-
half. The other problem is related to the dragging. In the
window when I drag downwards, then there is a limit, which
is probably
the minimum size of the text-field. However upwards I can
drag to the
top of the window, and the program does not stop me.
when I do this then the bottom text-field will overlap the
canvas and
I cannot do any more dragging, because the mouse cannot
sense the
dragging bar anymore. I suspect ther is some kind of mistake 

Can anyone help me with these problems? Thank you very much.

Peter Ivanyi


(module test mzscheme
  (require (lib "class.ss") 
         (lib "mred.ss" "mred")
         (lib "framework.ss" "framework"))

  (define win (new frame% (label "test") 
                                           (min-width 500)
(min-height 500)))
  (define vbox (new panel:vertical-dragable% (parent win)))
  (define hbox (new horizontal-panel% (parent vbox)))

  (define my%
    (class canvas% ()
      (define/override (on-size width height)
        (display (send vbox get-percentages))(newline))
      (super-instantiate () ) ) )
  (define gr  (new my% 
                   (parent hbox)
                   (min-width 100) (min-height 100)))
  (define option (new group-box-panel% (parent hbox)
                                    (stretchable-width #f)
                                    (label "Option menu")))
  (define history (new text-field%
                             (callback void)
                             (style '(multiple))
                             (label "")
                             (enabled #t)
                             (parent vbox)))
  ;;;;; (send vbox set-percentages '(6/10 4/10))
  (send win show #t)

Posted on the users mailing list.