Note: This is taken from the Chicken Wiki, where a more recent version could be available.

japi

Description

A set of bindings for the JAPI GUI toolkit.

Author

felix winkelmann

Requirements

None

Download

japi.egg

Documentation

The following constants and procedures are available:

<constant>j/left</constant> <constant>j/center</constant> <constant>j/right</constant> <constant>j/top</constant> <constant>j/bottom</constant> <constant>j/topleft</constant> <constant>j/topright</constant> <constant>j/bottomleft</constant> <constant>j/bottomright</constant>

<constant>j/default-cursor</constant> <constant>j/crosshair-cursor</constant> <constant>j/text-cursor</constant> <constant>j/wait-cursor</constant> <constant>j/sw-resize-cursor</constant> <constant>j/se-resize-cursor</constant> <constant>j/nw-resize-cursor</constant> <constant>j/ne-resize-cursor</constant> <constant>j/n-resize-cursor</constant> <constant>j/s-resize-cursor</constant> <constant>j/w-resize-cursor</constant> <constant>j/e-resize-cursor</constant> <constant>j/hand-cursor</constant> <constant>j/move-cursor</constant>

<constant>j/horizontal</constant> <constant>j/vertical</constant>

<constant>j/plain</constant> <constant>j/bold</constant> <constant>j/italic</constant> <constant>j/courier</constant> <constant>j/helvetia</constant> <constant>j/times</constant> <constant>j/dialogin</constant> <constant>j/dialogout</constant>

<constant>j/black</constant> <constant>j/white</constant> <constant>j/red</constant> <constant>j/green</constant> <constant>j/blue</constant> <constant>j/cyan</constant> <constant>j/magenta</constant> <constant>j/yellow</constant> <constant>j/orange</constant> <constant>j/green-yellow</constant> <constant>j/green-cyan</constant> <constant>j/blue-cyan</constant> <constant>j/blue-magenta</constant> <constant>j/red-magenta</constant> <constant>j/dark-gray</constant> <constant>j/light-gray</constant> <constant>j/gray</constant>

<constant>j/none</constant> <constant>j/linedown</constant> <constant>j/lineup</constant> <constant>j/areadown</constant> <constant>j/areaup</constant>

<constant>j/moved</constant> <constant>j/dragged</constant> <constant>j/pressed</constant> <constant>j/released</constant> <constant>j/entered</constant> <constant>j/exited</constant> <constant>j/doubleclick</constant>

<constant>j/resized</constant> <constant>j/hidden</constant> <constant>j/shown</constant>

<constant>j/activated</constant> <constant>j/deactivated</constant> <constant>j/opened</constant> <constant>j/closed</constant> <constant>j/iconified</constant> <constant>j/deiconified</constant> <constant>j/closing</constant>

<constant>j/gif</constant> <constant>j/jpg</constant> <constant>j/ppm</constant> <constant>j/bmp</constant>

<constant>j/round</constant> <constant>j/rect</constant>

<constant>j/randmax</constant>

Variables containing JAPI constants.

<procedure>(j:connect STRING) → INT</procedure> <procedure>(j:setport INT)</procedure> <procedure>(j:setdebug INT)</procedure> <procedure>(j:frame STRING) → INT</procedure> <procedure>(j:button INT STRING) → INT</procedure> <procedure>(j:graphicbutton INT STRING) → INT</procedure> <procedure>(j:checkbox INT STRING) → INT</procedure> <procedure>(j:label INT STRING) → INT</procedure> <procedure>(j:graphiclabel INT STRING) → INT</procedure> <procedure>(j:canvas INT INT INT) → INT</procedure> <procedure>(j:panel INT) → INT</procedure> <procedure>(j:borderpanel INT INT) → INT</procedure> <procedure>(j:radiogroup INT) → INT</procedure> <procedure>(j:radiobutton INT STRING) → INT</procedure> <procedure>(j:list INT INT) → INT</procedure> <procedure>(j:choice INT) → INT</procedure> <procedure>(j:dialog INT STRING) → INT</procedure> <procedure>(j:window INT) → INT</procedure> <procedure>(j:popupmenu INT STRING) → INT</procedure> <procedure>(j:scrollpane INT) → INT</procedure> <procedure>(j:hscrollbar INT) → INT</procedure> <procedure>(j:vscrollbar INT) → INT</procedure> <procedure>(j:line INT INT INT INT) → INT</procedure> <procedure>(j:printer INT) → INT</procedure> <procedure>(j:image INT INT) → INT</procedure> <procedure>(j:filedialog INT STRING STRING STRING) → STRING</procedure> <procedure>(j:fileselect INT STRING STRING STRING) → STRING</procedure> <procedure>(j:messagebox INT STRING STRING) → INT</procedure> <procedure>(j:alertbox INT STRING STRING STRING) → INT</procedure> <procedure>(j:progressbar INT INT) → INT</procedure> <procedure>(j:led INT INT INT) → INT</procedure> <procedure>(j:sevensegment INT INT) → INT</procedure> <procedure>(j:meter INT STRING) → INT</procedure> <procedure>(j:additem INT STRING)</procedure> <procedure>(j:textfield INT INT) → INT</procedure> <procedure>(j:textarea INT INT INT) → INT</procedure> <procedure>(j:menubar INT) → INT</procedure> <procedure>(j:menu INT STRING) → INT</procedure> <procedure>(j:helpmenu INT STRING) → INT</procedure> <procedure>(j:menuitem INT STRING) → INT</procedure> <procedure>(j:checkmenuitem INT STRING) → INT</procedure> <procedure>(j:pack INT)</procedure> <procedure>(j:print INT)</procedure> <procedure>(j:playsoundfile STRING)</procedure> <procedure>(j:play INT)</procedure> <procedure>(j:sound STRING) → INT</procedure> <procedure>(j:setfont INT INT INT INT)</procedure> <procedure>(j:setfontname INT INT)</procedure> <procedure>(j:setfontsize INT INT)</procedure> <procedure>(j:setfontstyle INT INT)</procedure> <procedure>(j:seperator INT)</procedure> <procedure>(j:disable INT)</procedure> <procedure>(j:enable INT)</procedure> <procedure>(j:getstate INT) → bool</procedure> <procedure>(j:getrows INT) → INT</procedure> <procedure>(j:getcolumns INT) → INT</procedure> <procedure>(j:getselect INT) → INT</procedure> <procedure>(j:isselect INT INT) → bool</procedure> <procedure>(j:isvisible INT) → bool</procedure> <procedure>(j:isparent INT INT) → bool</procedure> <procedure>(j:isresizable INT) → bool</procedure> <procedure>(j:select INT INT)</procedure> <procedure>(j:deselect INT INT)</procedure> <procedure>(j:multiplemode INT bool)</procedure> <procedure>(j:insert INT INT STRING)</procedure> <procedure>(j:remove INT INT)</procedure> <procedure>(j:removeitem INT STRING)</procedure> <procedure>(j:removeall INT)</procedure> <procedure>(j:setstate INT bool)</procedure> <procedure>(j:setrows INT INT)</procedure> <procedure>(j:setcolumns INT INT)</procedure> <procedure>(j:seticon INT INT)</procedure> <procedure>(j:setimage INT INT)</procedure> <procedure>(j:setvalue INT INT)</procedure> <procedure>(j:setradiogroup INT INT)</procedure> <procedure>(j:setunitinc INT INT)</procedure> <procedure>(j:setblockinc INT INT)</procedure> <procedure>(j:setmin INT INT)</procedure> <procedure>(j:setmax INT INT)</procedure> <procedure>(j:setdanger INT INT)</procedure> <procedure>(j:setslidesize INT INT)</procedure> <procedure>(j:setcursor INT INT)</procedure> <procedure>(j:setresizable INT bool)</procedure> <procedure>(j:getlength INT) → INT</procedure> <procedure>(j:getvalue INT) → INT</procedure> <procedure>(j:getdanger INT) → INT</procedure> <procedure>(j:getheight INT) → INT</procedure> <procedure>(j:getwidth INT) → INT</procedure> <procedure>(j:getinsets INT INT) → INT</procedure> <procedure>(j:getlayoutid INT) → INT</procedure> <procedure>(j:getinheight INT) → INT</procedure> <procedure>(j:getinwidth INT) → INT</procedure> <procedure>(j:gettext INT STRING) → STRING</procedure> <procedure>(j:getitem INT INT) → STRING</procedure> <procedure>(j:getitemcount INT) → INT</procedure> <procedure>(j:delete INT INT INT)</procedure> <procedure>(j:replacetext INT STRING INT INT)</procedure> <procedure>(j:appendtext INT STRING)</procedure> <procedure>(j:inserttext INT STRING INT)</procedure> <procedure>(j:settext INT STRING)</procedure> <procedure>(j:selectall INT)</procedure> <procedure>(j:selecttext INT INT INT)</procedure> <procedure>(j:getselstart INT) → INT</procedure> <procedure>(j:getselend INT) → INT</procedure> <procedure>(j:getseltext INT) → STRING</procedure> <procedure>(j:getcurpos INT) → INT</procedure> <procedure>(j:setcurpos INT INT)</procedure> <procedure>(j:setechochar INT char)</procedure> <procedure>(j:seteditable INT bool)</procedure> <procedure>(j:setshortcut INT char)</procedure> <procedure>(j:setsize INT INT INT)</procedure> <procedure>(j:show INT)</procedure> <procedure>(j:showpopup INT INT INT)</procedure> <procedure>(j:add INT INT)</procedure> <procedure>(j:release INT)</procedure> <procedure>(j:releaseall INT)</procedure> <procedure>(j:hide INT)</procedure> <procedure>(j:dispose INT)</procedure> <procedure>(j:setpos INT INT INT)</procedure> <procedure>(j:getviewportheight INT) → INT</procedure> <procedure>(j:getviewportwidth INT) → INT</procedure> <procedure>(j:getxpos INT) → INT</procedure> <procedure>(j:getypos INT) → INT</procedure> <procedure>(j:getparentid INT) → INT</procedure> <procedure>(j:setfocus INT)</procedure> <procedure>(j:hasfocus INT) → bool</procedure> <procedure>(j:getstringwidth INT STRING) → INT</procedure> <procedure>(j:getfontheight INT) → INT</procedure> <procedure>(j:getfontascent INT) → INT</procedure> <procedure>(j:keylistener INT) → INT</procedure> <procedure>(j:getkeycode INT) → INT</procedure> <procedure>(j:getkeychar INT) → INT</procedure> <procedure>(j:mouselistener INT INT) → INT</procedure> <procedure>(j:getmousex INT) → INT</procedure> <procedure>(j:getmousey INT) → INT</procedure> <procedure>(j:getmousebutton INT) → INT</procedure> <procedure>(j:focuslistener INT) → INT</procedure> <procedure>(j:componentlistener INT INT) → INT</procedure> <procedure>(j:windowlistener INT INT) → INT</procedure> <procedure>(j:setflowlayout INT INT)</procedure> <procedure>(j:setborderlayout INT)</procedure> <procedure>(j:setgridlayout INT INT INT)</procedure> <procedure>(j:setfixlayout INT)</procedure> <procedure>(j:setnolayout INT)</procedure> <procedure>(j:setborderpos INT INT)</procedure> <procedure>(j:sethgap INT INT)</procedure> <procedure>(j:setvgap INT INT)</procedure> <procedure>(j:setinsets INT INT INT INT INT)</procedure> <procedure>(j:setalign INT INT)</procedure> <procedure>(j:setflowfill INT bool)</procedure> <procedure>(j:translate INT INT INT)</procedure> <procedure>(j:cliprect INT INT INT INT INT)</procedure> <procedure>(j:drawrect INT INT INT INT INT)</procedure> <procedure>(j:fillrect INT INT INT INT INT)</procedure> <procedure>(j:drawroundrect INT INT INT INT INT INT INT)</procedure> <procedure>(j:fillroundrect INT INT INT INT INT INT INT)</procedure> <procedure>(j:drawoval INT INT INT INT INT)</procedure> <procedure>(j:filloval INT INT INT INT INT)</procedure> <procedure>(j:drawcircle INT INT INT INT)</procedure> <procedure>(j:fillcircle INT INT INT INT)</procedure> <procedure>(j:drawarc INT INT INT INT INT INT INT)</procedure> <procedure>(j:fillarc INT INT INT INT INT INT INT)</procedure> <procedure>(j:drawline INT INT INT INT INT)</procedure> <procedure>(j:drawpolyline INT INT VECTOR VECTOR)</procedure> <procedure>(j:drawpolygon INT INT VECTOR VECTOR)</procedure> <procedure>(j:fillpolygon INT INT VECTOR VECTOR)</procedure> <procedure>(j:drawpixel INT INT INT)</procedure> <procedure>(j:drawstring INT INT INT STRING)</procedure> <procedure>(j:setxor INT bool)</procedure> <procedure>(j:getimage INT) → INT</procedure> <procedure>(j:getimagesource INT INT INT INT INT VECTOR VECTOR VECTOR)</procedure> <procedure>(j:drawimagesource INT INT INT INT INT VECTOR VECTOR VECTOR)</procedure> <procedure>(j:getscaledimage INT INT INT INT INT INT INT) → INT</procedure> <procedure>(j:drawimage INT INT INT INT)</procedure> <procedure>(j:drawscaledimage INT INT INT INT INT INT INT INT INT INT)</procedure> <procedure>(j:setcolor INT INT INT INT)</procedure> <procedure>(j:setcolorbg INT INT INT INT)</procedure> <procedure>(j:setnamedcolor INT INT)</procedure> <procedure>(j:setnamedcolorbg INT INT)</procedure> <procedure>(j:loadimage STRING) → INT</procedure> <procedure>(j:saveimage INT STRING INT) → INT</procedure> <procedure>(j:sync)</procedure> <procedure>(j:beep)</procedure> <procedure>(j:random) → INTEGER</procedure> <procedure>(j:sleep INT)</procedure>

Calls the associated JAPI function. Integer-arrays are passed as vectors of exact numbers.

Examples

<example> <init>(require 'japi)</init> <expr> ; The canonical example (j:start) (define f (j:frame "Hello, world!")) (j:show f) (read-line) (j:quit) </expr> </example>

<example> <init>(require 'japi)</init> <expr> ; The "vumeter" example in Scheme (require 'japi)

(j:setdebug 2) (define value 50)

(unless (j:start)

 (error "can't connect to server") )

(define frame (j:frame "Meter")) (j:setborderlayout frame) (j:setinsets frame (+ (j:getinsets frame j/top) 10) 10 10 10) (j:setvgap frame 10) (define progress (j:progressbar frame j/horizontal)) (j:setborderpos progress j/bottom) (define meter (j:meter frame "Volt")) (j:setsize frame 150 170) (j:show frame) (j:setmin meter -100) (j:setmax meter 200) (j:setdanger meter 100)

(do ()

   ((eq? frame (j:getaction)))
 (set! value (sub1 value))
 (when (< (j:random) (/ j/randmax 2))
   (set! value (+ value 2)) )
 (j:setvalue meter value)
 (j:setvalue progress value)
 (j:sync)
 (j:sleep 50) )

(j:quit) </expr> </example>

Changelog