[plt-scheme] GUI guides?

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Sun Jul 5 20:51:38 EDT 2009

Hugh Myers wrote:
> Am solving some of these as I try and think of questions to ask. Some
> of the answers raise questions about what is or isn't do-able. For
> instance given fixed width symbol font (like all chess fonts) it would
> be nice to ask how wide and how tall a given text string is. This
> could be used to 'size' the window before display. Nothing I've seen
> yet even hints that this is possible, yet it seems quit reasonable.

I think you want 'get-text-extent' in 'dc<%>' (drawing context).

Here are some rough guidelines:

  - 'editor<%>' and 'text%' deal with the text, its styles, 
modifications to the text, high-level display concerns (word wrapping, 
visible/ region, etc).

  - 'canvas<%>' and 'editor-canvas%' deal with the gui concerns: 
dimensions of the editor widget, its auxiliary gui elements 
(scrollbars), etc.

  - 'dc<%>' deals with rendering issues, like how big a string in a 
particular font will be rendered on screen.

Browsing those classes and interfaces is a good way to get an idea of 
what functionality is available and how it's provided. Remember to look 
at the superclasses and superinterfaces, too.


Posted on the users mailing list.