1 Implementing Dr Scheme Tools
2 Adding Languages to Dr Scheme
3 Creating New Kinds of Dr Scheme Frames
4 Extending the Existing Dr Scheme Classes
5 Expanding the User’s Program Text and Breaking
6 Editor Modes
7 Language-specific capabilities
8 drscheme: get/ extend
9 drscheme: unit
10 drscheme: language
11 drscheme: language-configuration
12 drscheme: debug
13 drscheme: rep
14 drscheme: frame
15 drscheme: help-desk
16 drscheme: eval
17 drscheme: modes
Index
On this page:
drscheme: language-configuration: get-languages
drscheme: language-configuration: add-language
drscheme: language-configuration: get-settings-preferences-symbol
drscheme: language-configuration: make-language-settings
drscheme: language-configuration: language-settings-settings
drscheme: language-configuration: language-settings-language
drscheme: language-configuration: language-settings?
drscheme: language-configuration: language-dialog
drscheme: language-configuration: fill-language-dialog
Version: 4.0.2

 

11 drscheme:language-configuration

(drscheme:language-configuration:get-languages)

  (listof (is-a?/c drscheme:language:language<%>))

This can only be called after all of the tools initialization phases have completed.

Returns the list of all of the languages installed in DrScheme.

(drscheme:language-configuration:add-language language)  void?

  language : (and/c (is-a?/c drscheme:language:language<%>) drscheme:language:object/c)

This function can only be called in phase 2 (see Implementing DrScheme Tools for details).

Adds language to the languages offerend by DrScheme.

(drscheme:language-configuration:get-settings-preferences-symbol)

  symbol?

Returns the symbol that is used to store the user’s language settings. Use as an argument to either preferences:get or preferences:set.

(drscheme:language-configuration:make-language-settings

 

 

 

language

 

 

 

settings)

 

  drscheme:language-configuration:language-settings?

  language : (or/c (is-a?/c drscheme:language:language<%>) drscheme:language:object/c)

  settings : any/c

This is the constructor for a record consisting of two elements, a language and its settings.

The settings is a language-specific record that holds a value describing a parameterization of the language.

It has two selectors, drscheme:language-configuration:language-settings-language and drscheme:language-configuration:language-settings-settings, and a predicate, drscheme:language-configuration:language-settings?

(drscheme:language-configuration:language-settings-settings ls)

  any/c

  ls : drscheme:language-configuration:language-settings?

Extracts the settings field of a language-settings.

(drscheme:language-configuration:language-settings-language ls)

  (or/c (is-a?/c drscheme:language:language<%>) drscheme:language:object/c)

  ls : drscheme:language-configuration:language-settings?

Extracts the language field of a language-settings.

(drscheme:language-configuration:language-settings? val)

  boolean?

  val : any/c

Determines if the argument is a language-settings or not.

(drscheme:language-configuration:language-dialog

 

 

 

show-welcome?

 

 

 

language-settings-to-show

 

 

 [

parent])

 

  (or/c false/c drscheme:language-configuration:language-settings?)

  show-welcome? : boolean?

  language-settings-to-show : drscheme:language-configuration:language-settings?

  parent : (or/c false/c (is-a?/c top-level-window<%>)) = #t

Opens the language configuration dialog. See also drscheme:language-configuration:fill-language-dialog.

The show-welcome? argument determines if if a “Welcome to DrScheme” message and some natural language buttons are shown.

The language-settings-to-show argument must be some default language settings that the dialog is initialized to. If unsure of a default, the currently set language in the user’s preferences can be obtained via:

  (preferences:get (drscheme:language-configuration:get-settings-preferences-symbol))

The parent argument is used as the parent to the dialog.

The result if #f when the user cancells the dialog, and the selected language if they hit ok.

(drscheme:language-configuration:fill-language-dialog

 

 

 

panel

 

 

 

button-panel

 

 

 

language-setting

 

 

 [

re-center

 

 

 

ok-handler])

 

  drscheme:language-configuration:language-settings?

  panel : (is-a?/c vertical-panel%)

  button-panel : (is-a?/c area-container<%>)

  language-setting : drscheme:language-configuration:language-settings?

  re-center : (or/c false/c (is-a?/c top-level-window<%>)) = #f

  ok-handler : (-> symbol? void?) = void

This procedure accepts two parent panels and fills them with the contents of the language dialog. It is used to include language configuration controls in some larger context in another dialog.

The panel argument is the main panel where the language controls will be placed. The function adds buttons to the button-panel to revert a language to its default settings and to show the details of a language.

The language-setting is the default language to show in the dialog.

The re-center argument is used when the Show Details button is clicked. If that argument is a top-level-window<%>, the Show Details callback will recenter the window each time it is clicked. Otherwise, the argument is not used.

ok-handler is a function that is in charge of interfacing the OK button. It should accept a symbol message: 'enable and 'disable to toggle the button, and 'execute to run the desired operation. (The language selection dialog also uses an internal 'enable-sync message.)