9.2  Name-Message Functions

(calc-button-min-sizes dc string)      PROCEDURE

Calculates the minimum width and height of a button label (when drawn with draw-frame-button-label). Returns two values: the width and height.

(draw-frame-button-label dc string width height inverted)      PROCEDURE

Draws a button label like the one for the (define ...) and filename buttons in the top-left corner of the DrScheme frame. Use this function to draw similar buttons.

The basic idea is to create a canvas object whose on-paint method is overridden to call this function. The dc argument should be canvas's drawing context, and string should be the string to display on the button. The width and height arguments should be the width and height of the button, and inverted? should be #t when the button is pressed.

See calc-button-min-sizes for help calculating the min sizes of the button.