[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.38 AWT support

Procedures for the Java AWT framework.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.38.1 Desktop operation

Function: desktop-supported? [operation]

returns #t if the desktop operation is supported in your environment.
operation must be a symbol shown as follows.

browsesupports starting a Web browser
editsupports editing a file
mailsupports starting a mailer
opensupports opening a file
printsupports printing a file
Function: desktop-browse uri
Function: desktop-edit file
Function: desktop-mail [uri]
Function: desktop-open file
Function: desktop-print file

browses the URL, edits the file, sends a mail to the URI, opens the file and prints the file respectively.
This procedure returns #t when the operation is succeed or #f when the operation is not supported.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.38.2 Graphics environment

Function: graphics-all-fonts

returns a list of all font objects supported in your environment.

Function: graphics-default-screen-device

returns the default screen device object in your environment.

Function: graphics-device-full-screen-set! [screen-device] frame

displays the frame in the full screen mode.

Function: graphics-screen-devices

returns a list of all screen device objects supported in your environment.

Function: graphics-device-full-screen? [screen-device]

returns #t when the screen device is in the full screen mode.

Function: graphics-device-full-screen-supported? [screen-device]

returns #t if the screen device supports full screen mode.

Function: graphics-headless?

returns #t if your environment is headless (doesn’t have any graphics environment).


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.38.3 GUI robots

Function: make-gui-robot [screen-device]

creates a GUI robot object.

Function: capture-screen [gui-robot] x1 y1 x2 y2

takes a screen shot in the given coordinates and returns it as an image object.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.38.4 Tray icons

Function: tray-supported?

returns #t if your environment supports tray icons.

Function: make-tray-icon image-file-path/image-object tooptip/#f menu/#f [action] [mouse-action] [mouse-motion-action]

creates a tray icon.
image-file-path/image-object specifies an icon image by a file or a image object.
tooltip specifies a tooltip or doesn’t specify any tooltips if tooltip is #f.
menu specifies a menu or doesn’t specify any menus if tooltip is #f. The menu should specify as follows.

`(("menu1"  . ,(lambda (e) action))  ; a simple menu
  ("menusA"  ; a nested menu
    ("sub1" . ,(lambda (e) action))
    ("sub2" . ,(lambda (e) action))
    ...)
  ...)

action, mouse-action and mouse-motion-action specifies actions when the icon is double-clicked, the mouse is moved and the mouse is moved(detail), respectively.
Here is an example.

; definition of a tray icon
(define icon
  (make-tray-icon
    "example.png"
    "test"
    `(("sub"  ; a menu structure
        (("A" ,(lambda (e) (display "a")))
         ("b" ,(lambda (e) (display "b")))))
      ("Exit" ,(lambda (e) (exit))))
    (lambda (e) (display "icon")) ; action
    `(; mouse action
      :entered ,(lambda (e) (display "entered"))
      :exited  ,(lambda (e) (display "exited")))))
Function: add-tray-icon! tray-icon

adds the tray icon to the system tray.

Function: display-tray-icon-message title message [type]

sends the message to the given tray icon.
message must be a symbol shown as follows.

errorerror
warningwarning
infoinformation(default)
nonewithout any types

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.38.5 Changing the shape of cursur

Function: cursor-set! componet [shape]

changes the shape of the cursor. shape must be a symbol shown as follows or a string. You can specify system native cursor shapes by specifing shape as a string.

default-cursordefault shape
hand-cursorhand
crosshair-cursorcrosshair
move-cursormove cursor
n-resize-cursorresize (north)
s-resize-cursorresize (south)
e-resize-cursorresize (east)
w-resize-cursorresize (west)
ne-resize-cursorresize (northeast)
nw-resize-cursorresize (northwest)
se-resize-cursorresize (southeast)
sw-resize-cursorresize (southwest)
text-cursortext
wait-cursorwaiting

[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on August 9, 2012 using texi2html 5.0.