17 Handler
procedure
(handler:handler? obj) → boolean?
obj : any/c
procedure
(handler:handler-name handler) → string?
handler : handler:handler?
procedure
(handler:handler-extension handler)
→ (or/c (path? . -> . boolean?) (listof string?)) handler : handler:handler?
procedure
(handler:handler-handler handler)
→ (path? . -> . (is-a?/c frame:editor<%>)) handler : handler:handler?
procedure
(handler:insert-format-handler name pred handler) → void? name : string? pred : (or/c string? (listof string?) (path? . -> . boolean?)) handler : (path? . -> . (or/c false/c (is-a?/c frame:editor<%>)))
The string, name names the format handler for use with handler:find-named-format-handler. If pred is a string, it is matched with the extension of a filename by handler:find-format-handler. If pred is a list of strings, they are each matched with the extension of a filename by handler:find-format-handler. If it is a function, the filename is applied to the function and the functions result determines if this is the handler to use.
procedure
(handler:find-format-handler filename)
→ (or/c #f (-> path? (is-a?/c frame:editor<%>))) filename : path?
procedure
(handler:edit-file filename [ make-default #:start-pos start-pos #:end-pos end-pos]) → (or/c false/c (is-a?/c frame:editor<%>)) filename : (or/c path? symbol? #f)
make-default : (-> (is-a?/c frame:editor<%>)) = (λ () ((handler:current-create-new-window) (and (path? filename) filename))) start-pos : (or/c exact-nonnegative-integer? #f) = #f end-pos : (or/c exact-nonnegative-integer? #f) = start-pos
- If filename is a string or a symbol, this function checks the result of group:get-the-frame-group’s locate-file method to see if the filename is already open by a frame in the group.
If so, it returns the frame.
If a handler is found, it is applied to filename and its result is the final result.
If not, make-default is used.
If the file is not already open by a frame in the group and if filename is a symbol, make-default is used.
If filename is #f, make-default is used.
Changed in version 1.75 of package gui-lib: generalized the filename argument to allow symbols and added the start-pos and end-pos arguments.
parameter
→ (-> (or/c false/c path?) (is-a?/c frame%)) (handler:current-create-new-window proc) → void? proc : (-> (or/c false/c path?) (is-a?/c frame%))
(λ (filename) (let ([frame (make-object frame:text-info-file% filename)]) (send frame show #t) frame))
procedure
(handler:open-file [dir])
→ (or/c false/c (is-a?/c frame:basic<%>)) dir : (or/c false/c path? string?) = #f
procedure
(handler:install-recent-items menu) → void?
menu : (is-a?/c menu%)
procedure
frame : (implementation?/c frame:standard-menus<%>)
procedure
(handler:add-to-recent filename) → void?
filename : path?
procedure
(handler:set-recent-position filename start end) → void? filename : path? start : number? end : number?
procedure
num : number?
procedure