On this page:
rkdt

1 Opening an editor🔗ℹ

procedure

(rkdt [filename    
  #:wait? wait?    
  #:width width    
  #:height height    
  #:x x    
  #:y y    
  #:frame-cb frame-cb])  void?
  filename : (or/c path-string? #f) = #f
  wait? : boolean? = #f
  width : exact-positive-integer? = 900
  height : exact-positive-integer? = 650
  x : exact-integer? = 100
  y : exact-integer? = 100
  frame-cb : procedure? = (λ (call-time frame) #t)
Purpose. Opens an editor window. When filename is a path or string, that file is opened. When filename is #f, which is the default, an empty editor is opened.

Preconditions. When supplied, filename identifies the file to open. frame-cb must accept two arguments: a lifecycle symbol and the editor frame. The geometry arguments specify valid dimensions and screen coordinates.

Postconditions. An editor frame has been created and shown. When wait? is #f, rkdt returns after the frame has been shown and the 'after-show callback has run. When wait? is #t, rkdt waits until the frame is closed.

Result. The procedure returns (void). The editor frame itself is made available to frame-cb during its lifecycle callbacks.

Internal workings. A non-false filename is converted to a string before it is supplied to the Framework editor frame. A false filename is passed through as #f, causing the frame to start without a file.

Each open editor receives an internal number. That number is appended to the window title and is used to distinguish stored window geometry. Numbers belonging to closed editors are reused. On close, the current position and size are stored for that internal number and the current screen configuration.

The #:width, #:height, #:x, and #:y arguments specify the initial geometry when no stored geometry is available. Stored geometry is associated with the screen configuration derived from the number and dimensions of the displays visible to Racket. Changing the monitor configuration therefore selects a different set of stored geometry values.

The standard File menu does not contain the Exit or Quit command. Closing an editor window closes only that window.