Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

membrane.ui


-default-mouse-move-globalclj/s

(-default-mouse-move-global elem offset)
source

Arcclj/s

source

Borderedclj/s

source

borderedclj/s

(bordered padding drawable)

Graphical elem that will draw drawable with a gray border.

Graphical elem that will draw drawable with a gray border.
sourceraw docstring

bordered-drawclj/s

(bordered-draw this)
source

boundsclj/s

(bounds elem)

Returns a 2 element vector with the [width, height] of an element's bounds with respect to its origin

Returns a 2 element vector with the [width, height] of an element's bounds with respect to its origin
sourceraw docstring

box-contains?clj/s

(box-contains? [x y width height] [px py])

Tests whether [px py] is within [x y width height].

Tests whether [px py] is within  [x y width height].
sourceraw docstring

Buttonclj/s

source

buttonclj/s

(button text)
(button text on-click)
(button text on-click hover?)

Graphical elem that draws a button. Optional on-click function may be provided that is called with no arguments when button has a mouse-down event.

Graphical elem that draws a button. Optional on-click function may be provided that is called with no arguments when button has a mouse-down event.
sourceraw docstring

button-drawclj/s

(button-draw this)
source

centerclj/s

(center elem [width height])
source

Checkboxclj/s

source

checkboxclj/s

(checkbox checked?)

Graphical elem that will draw a checkbox.

Graphical elem that will draw a checkbox.
sourceraw docstring

childrenclj/s

(children elem)

Returns sub elements of elem. Useful for traversal.

Returns sub elements of elem. Useful for traversal.
sourceraw docstring

clipboard-copyclj/s

(clipboard-copy elem)

Returns the effects of a clipboard copy event on elem.

Returns the effects of a clipboard copy event on elem.
sourceraw docstring

clipboard-cutclj/s

(clipboard-cut elem)

Returns the effects of a clipboard cut event on elem.

Returns the effects of a clipboard cut event on elem.
sourceraw docstring

clipboard-pasteclj/s

(clipboard-paste elem s)

Returns the effects of a clipboard paste event on elem.

Returns the effects of a clipboard paste event on elem.
sourceraw docstring

copy-to-clipboardclj/s

(copy-to-clipboard s)
source

default-fontclj/s

source

defcomponentclj/smacro

(defcomponent name [& fields] & opts+specs)
source

draw-checkboxclj/s

(draw-checkbox checked?)
source

EventHandlerclj/s

source

fill-borderedclj/s

(fill-bordered color padding drawable)

Graphical elem that will draw elem with filled border.

Graphical elem that will draw elem with filled border.
sourceraw docstring

fill-bordered-drawclj/s

(fill-bordered-draw this)
source

FillBorderedclj/s

source

filled-rectangleclj/s

(filled-rectangle color width height)

Graphical elem that draws a filled rectangle with color, [r g b] or [r g b a].

Graphical elem that draws a filled rectangle with color, [r g b] or [r g b a].
sourceraw docstring

fontclj/s

(font name size)

Creates a font.

name: Should be the path to a font file on desktop. If nil, use the default font. size: Size of the font. If nil, use the default font size.

Creates a font.

`name`: Should be the path to a font file on desktop. If nil, use the default font.
`size`: Size of the font. If nil, use the default font size.
sourceraw docstring

Fontclj/s

source

groupclj/s

(group & drawables)

Creates a graphical elem that will draw drawables in order

Creates a graphical elem that will draw drawables in order
sourceraw docstring

Groupclj/s

source

heightclj/s

(height elem)

Returns the height of elem.

Returns the height of elem.
sourceraw docstring

horizontal-layoutclj/s

(horizontal-layout & elems)

Returns a graphical elem of elems layed out next to eachother.

Returns a graphical elem of elems layed out next to eachother.
sourceraw docstring

IBoundsclj/sprotocol

-boundsclj/s

(-bounds elem)

Returns a 2 element vector with the [width, height] of an element's bounds with respect to its origin

Returns a 2 element vector with the [width, height] of an element's bounds with respect to its origin
source

IBubbleclj/sprotocol

Allows an element add, remove, modify effects emitted from its children.

Allows an element add, remove, modify effects emitted from its children.

-bubbleclj/s

(-bubble _ effects)

Called when an effect is being emitted by a child element. The parent element can either return the same effects or allow them to continue to bubble.

Called when an effect is being emitted by a child element. The parent element can either return the same effects or allow them to continue to bubble.
sourceraw docstring

IChildrenclj/sprotocol

-childrenclj/s

(-children elem)

Returns sub elements of elem. Useful for traversal.

Returns sub elements of elem. Useful for traversal.
source

IClipboardCopyclj/sprotocol

-clipboard-copyclj/s

(-clipboard-copy _)
source

IClipboardCutclj/sprotocol

-clipboard-cutclj/s

(-clipboard-cut _)
source

IClipboardPasteclj/sprotocol

-clipboard-pasteclj/s

(-clipboard-paste this info)
source

IComponentclj/sprotocol

source

IDrawclj/sprotocol

drawclj/s

(draw this)
source

IHandleEventclj/sprotocol

-can-handle?clj/s

(-can-handle? this event-type)

-handle-eventclj/s

(-handle-event this event-type event-args)
source

IHasKeyEventclj/sprotocol

has-key-eventclj/s

(has-key-event this)
source

IHasKeyPressclj/sprotocol

has-key-pressclj/s

(has-key-press this)
source

IHasMouseMoveGlobalclj/sprotocol

has-mouse-move-globalclj/s

(has-mouse-move-global this)
source

IKeyEventclj/sprotocol

-key-eventclj/s

(-key-event this key scancode action mods)
source

IKeyPressclj/sprotocol

-key-pressclj/s

(-key-press this info)
source

IKeyTypeclj/sprotocol

-key-typeclj/s

(-key-type this info)
source

imageclj/s

(image image-path)
(image image-path [width height :as size])
(image image-path [width height :as size] opacity)

Graphical element that draws an image.

image-path: using the skia backend, image-path can be one of

  • a string filename
  • a java.net.URL This is useful for drawing images included in a jar. Simply put your image in your resources folder, typically resources. Draw the images in the jar with (ui/image (clojure.java.io/resource "filename.png"))

The image can be drawn at a different size by supplying a size. Supply a nil size will use the the original image size.

The image can be aspect scaled by supply a size with one of the dimensions as nil.

For example, to draw an image with width 30 with aspect scaling, (image "path.png" [30 nil])

opacity is a float between 0 and 1.

Allowable image formats may vary by platform, but will typically include png and jpeg.

Graphical element that draws an image.

`image-path`: using the skia backend, `image-path` can be one of
- a string filename
- a java.net.URL
This is useful for drawing images included in a jar. Simply put your image in your resources folder, typically resources.
Draw the images in the jar with `(ui/image (clojure.java.io/resource "filename.png"))`

The image can be drawn at a different size by supplying a size.
Supply a nil size will use the the original image size.

The image can be aspect scaled by supply a size with one of the dimensions as nil.

For example, to draw an image with width 30 with aspect scaling, `(image "path.png" [30 nil])`

opacity is a float between 0 and 1.

Allowable image formats may vary by platform, but will typically include png and jpeg.
sourceraw docstring

Imageclj/s

source

image-sizeclj/s≠

(image-size image-path)
clj

Returns the [width, height] of the file at image-path.

Returns the [width, height] of the file at image-path.
source (clj)source (cljs)raw docstring

IMouseDownclj/sprotocol

-mouse-downclj/s

(-mouse-down this info)
source

IMouseEventclj/sprotocol

-mouse-eventclj/s

(-mouse-event this pos button mouse-down? mods)
source

IMouseMoveclj/sprotocol

-mouse-moveclj/s

(-mouse-move this info)
source

IMouseMoveGlobalclj/sprotocol

-mouse-move-globalclj/s

(-mouse-move-global this info)
source

IMouseUpclj/sprotocol

-mouse-upclj/s

(-mouse-up this info)
source

IMouseWheelclj/sprotocol

-mouse-wheelclj/s

(-mouse-wheel this info)
source

index-for-positionclj/s

(index-for-position font text x y)
source

IOriginclj/sprotocol

-originclj/s

(-origin elem)

Specifies the top left corner of a component's bounds

The origin is vector or 2 numbers [x, y]

Specifies the top left corner of a component's bounds

The origin is vector or 2 numbers [x, y]
source

IScrollclj/sprotocol

-scrollclj/s

(-scroll this info)
source

key-eventclj/s

(key-event elem key scancode action mods)

Returns the effects of a key event on elem.

Returns the effects of a key event on elem.
sourceraw docstring

key-pressclj/s

(key-press elem key)

Returns the effects of a key press event on elem.

Returns the effects of a key press event on elem.
sourceraw docstring

labelclj/s

(label text)
(label text font)

Graphical elem that can draw text.

label will use the default line spacing for newline. font should be a membrane.ui.Font

Graphical elem that can draw text.

label will use the default line spacing for newline.
font should be a membrane.ui.Font
sourceraw docstring

Labelclj/s

source

make-event-handlerclj/s

(make-event-handler protocol-name protocol protocol-fn)
source

maybe-key-eventclj/smacro

(maybe-key-event test body)
source

memoize-varclj/s

(memoize-var f)

Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same arguments are repeated often, has higher performance at the expense of higher memory use.

Returns a memoized version of a referentially transparent function. The
memoized version of the function keeps a cache of the mapping from arguments
to results and, when calls with the same arguments are repeated often, has
higher performance at the expense of higher memory use.
sourceraw docstring

mouse-downclj/s

(mouse-down elem [mx my :as pos])

Returns the effects of a mouse down event on elem. Will only call -mouse-event or -mouse-down if the position is in the element's bounds.

Returns the effects of a mouse down event on elem. Will only call -mouse-event or -mouse-down if the position is in the element's bounds.
sourceraw docstring

mouse-eventclj/s

(mouse-event elem global-pos button mouse-down? mods)
(mouse-event elem global-pos button mouse-down? mods offset)

Returns the effects of a mouse move event on elem. Will only call -mouse-move on mouse events within an elements bounds.

mouse-event is used for both mouse up and mouse down events.

Returns the effects of a mouse move event on elem. Will only call -mouse-move on mouse events within an elements bounds.

mouse-event is used for both mouse up and mouse down events.
sourceraw docstring

mouse-moveclj/s

(mouse-move elem global-pos)
(mouse-move elem global-pos offset)

Returns the effects of a mouse move event on elem. Will only call -mouse-move on mouse events within an elements bounds.

Returns the effects of a mouse move event on elem. Will only call -mouse-move on mouse events within an elements bounds.
sourceraw docstring

mouse-move-globalclj/s

(mouse-move-global elem global-pos)
(mouse-move-global elem global-pos offset)

Returns the effects of a mouse move event on elem. Will -mouse-move-global for all elements and their children.

Returns the effects of a mouse move event on elem. Will -mouse-move-global for all elements and their children.
sourceraw docstring

mouse-upclj/s

(mouse-up elem [mx my :as pos])

Returns the effects of a mouse up event on elem. Will only call -mouse-event or -mouse-down if the position is in the element's bounds.

Returns the effects of a mouse up event on elem. Will only call -mouse-event or -mouse-down if the position is in the element's bounds.
sourceraw docstring

no-eventsclj/s

(no-events body)
source

NoEventsclj/s

source

NoKeyEventclj/s

source

onclj/s

(on & events)

Wraps an elem with event handlers.

events are pairs of events and event handlers and the last argument should be an elem.

example:

Adds do nothing event handlers for mouse-down and mouse-up events on a label that says "Hello!" (on :mouse-down (fn [[mx my]] nil) :mouse-up (fn [[mx my]] nil) (label "Hello!"))

Wraps an elem with event handlers.

events are pairs of events and event handlers and the last argument should be an elem.

example:

Adds do nothing event handlers for mouse-down and mouse-up events on a label that says "Hello!"
(on :mouse-down (fn [[mx my]] nil)
    :mouse-up (fn [[mx my]] nil)
   (label "Hello!"))
sourceraw docstring

on-bubbleclj/s

(on-bubble on-bubble & drawables)

Wraps drawables and adds a handler for bubbling

on-bubble should take seq of effects

Wraps drawables and adds a handler for bubbling

on-bubble should take seq of effects
sourceraw docstring

on-clickclj/s

(on-click on-click & drawables)

Wrap an element with a mouse down event handler, on-click.

on-click must accept 0 arguments and should return a sequence of effects.

Wrap an element with a mouse down event handler, on-click. 

on-click must accept 0 arguments and should return a sequence of effects.
sourceraw docstring

on-clipboard-copyclj/s

(on-clipboard-copy on-clipboard-copy & drawables)

Wraps drawables and adds a handler for clipboard copy events.

on-clipboard-copy should take 0 arguments and return a sequence of effects.

Wraps drawables and adds a handler for clipboard copy events.

on-clipboard-copy should take 0 arguments and return a sequence of effects.
sourceraw docstring

on-clipboard-cutclj/s

(on-clipboard-cut on-clipboard-cut & drawables)

Wraps drawables and adds a handler for clipboard cut events.

on-clipboard-copy should take 0 arguments and return a sequence of effects.

Wraps drawables and adds a handler for clipboard cut events.

on-clipboard-copy should take 0 arguments and return a sequence of effects.
sourceraw docstring

on-clipboard-pasteclj/s

(on-clipboard-paste on-clipboard-paste & drawables)

Wraps drawables and adds a handler for clipboard paste events.

on-clipboard-paste should take 1 arguments s and return a sequence of effects.

Wraps drawables and adds a handler for clipboard paste events.

on-clipboard-paste should take 1 arguments s and return a sequence of effects.
sourceraw docstring

on-key-eventclj/s

(on-key-event on-key-event & drawables)

Wraps drawables and adds a handler for key events.

on-key-event should take 4 arguments key, scancode, action, mods and return a sequence of effects.

Wraps drawables and adds a handler for key events.

on-key-event should take 4 arguments key, scancode, action, mods and return a sequence of effects.
sourceraw docstring

on-key-pressclj/s

(on-key-press on-key-press & drawables)

Wraps drawables and adds an event handler for key-press events.

on-key-press should take 1 argument key and return a sequence of effects.

Wraps drawables and adds an event handler for key-press events.

on-key-press should take 1 argument key and return a sequence of effects.
sourceraw docstring

on-mouse-downclj/s

(on-mouse-down on-mouse-down & drawables)

Wraps drawables and adds an event handler for mouse-down events.

on-mouse-down should take 1 argument [mx my] of the mouse position in local coordinates and return a sequence of effects.

Wraps drawables and adds an event handler for mouse-down events.

on-mouse-down should take 1 argument [mx my] of the mouse position in local coordinates and return a sequence of effects.
sourceraw docstring

on-mouse-eventclj/s

(on-mouse-event on-mouse-event & drawables)

Wraps drawables and adds an event handler for mouse events.

on-mouse-event should take 4 arguments [pos button mouse-down? mods] and return a sequence of effects.

Wraps drawables and adds an event handler for mouse events.

on-mouse-event should take 4 arguments [pos button mouse-down? mods] and return a sequence of effects.
sourceraw docstring

on-mouse-moveclj/s

(on-mouse-move on-mouse-move & drawables)

Wraps drawables and adds an event handler for mouse-move events.

on-mouse-move down should take 1 argument [mx my] of the mouse position in local coordinates and return a sequence of effects.

Wraps drawables and adds an event handler for mouse-move events.

on-mouse-move down should take 1 argument [mx my] of the mouse position in local coordinates and return a sequence of effects.
sourceraw docstring

on-mouse-move-globalclj/s

(on-mouse-move-global on-mouse-move-global & drawables)

Wraps drawables and adds an event handler for mouse-move-global events.

on-mouse-move-global down should take 1 argument [mx my] of the mouse position in global coordinates and return a sequence of effects.

Wraps drawables and adds an event handler for mouse-move-global events.

on-mouse-move-global down should take 1 argument [mx my] of the mouse position in global coordinates and return a sequence of effects.
sourceraw docstring

on-mouse-upclj/s

(on-mouse-up on-mouse-up & drawables)

Wraps drawables and adds an event handler for mouse-up events.

on-mouse-up should take 1 argument [mx my] of the mouse position in local coordinates and return a sequence of effects.

Wraps drawables and adds an event handler for mouse-up events.

on-mouse-up should take 1 argument [mx my] of the mouse position in local coordinates and return a sequence of effects.
sourceraw docstring

on-scrollclj/s

(on-scroll on-scroll & drawables)

Wraps drawables and adds an event handler for scroll events.

on-scroll should take 1 argument [offset-x offset-y] of the scroll offset and return a sequence of effects.

Wraps drawables and adds an event handler for scroll events.

on-scroll should take 1 argument [offset-x offset-y] of the scroll offset and return a sequence of effects.
sourceraw docstring

OnBubbleclj/s

source

OnClickclj/s

source

OnClipboardCopyclj/s

source

OnClipboardCutclj/s

source

OnClipboardPasteclj/s

source

OnKeyEventclj/s

source

OnKeyPressclj/s

source

OnMouseDownclj/s

source

OnMouseEventclj/s

source

OnMouseMoveclj/s

source

OnMouseMoveGlobalclj/s

source

OnMouseUpclj/s

source

OnScrollclj/s

source

originclj/s

(origin elem)

Specifies the top left corner of a component's bounds

The origin is vector or 2 numbers [x, y]

Specifies the top left corner of a component's bounds

The origin is vector or 2 numbers [x, y]
sourceraw docstring

origin-xclj/s

(origin-x elem)

Convience function for returning the x coordinate of elem's origin

Convience function for returning the x coordinate of elem's origin
sourceraw docstring

origin-yclj/s

(origin-y elem)

Convience function for returning the y coordinate of elem's origin

Convience function for returning the y coordinate of elem's origin
sourceraw docstring

paddingclj/s

(padding px py elem)
source

Paddingclj/s

source

Pathclj/s

source

pathclj/s

(path & points)

A graphical element that will draw lines connecting points.

See with-style, with-stroke-width, and with-color for more options.

A graphical element that will draw lines connecting points.

See with-style, with-stroke-width, and with-color for more options.
sourceraw docstring

PWrappedcljprotocol

-unwrapclj

(-unwrap this)
source

rectangleclj/s

(rectangle width height)

Graphical elem that draws a rectangle.

See with-style, with-stroke-width, and with-color for more options.

Graphical elem that draws a rectangle.

See with-style, with-stroke-width, and with-color for more options.
sourceraw docstring

Rotateclj/s

source

rounded-rectangleclj/s

(rounded-rectangle width height border-radius)

Graphical elem that draws a rounded rectangle.

Graphical elem that draws a rounded rectangle.
sourceraw docstring

RoundedRectangleclj/s

source

runclj/s

(run & args)
source

run-syncclj

(run-sync & args)
source

scaleclj/s

(scale sx sy & drawables)

Draw drawables using scalars which is a vector of [scale-x scale-y]

Draw drawables using scalars which is a vector of [scale-x scale-y]
sourceraw docstring

Scaleclj/s

source

scissor-viewclj/s

(scissor-view offset bounds drawable)

Graphical elem to only draw drawable within bounds with an offset.

All other drawing will be clipped.

Graphical elem to only draw drawable within bounds with an offset.

All other drawing will be clipped.
sourceraw docstring

ScissorViewclj/s

source

scrollclj/s

(scroll elem [offset-x offset-y :as offset])

Returns the effects of a scroll event on elem.

Returns the effects of a scroll event on elem.
sourceraw docstring

ScrollViewclj/s

source

scrollviewclj/s

(scrollview bounds offset drawable)

Graphical elem that will draw drawable offset by offset and clip its drawings to bounds.

Graphical elem that will draw drawable offset by offset and clip its drawings to bounds. 
sourceraw docstring

Spacerclj/s

source

spacerclj/s

(spacer x y)

An empty graphical element with width x and height y.

Useful for layout.

An empty graphical element with width x and height y.

Useful for layout.
sourceraw docstring

text-boundsclj/s

source

text-cursorclj/s

(text-cursor text cursor)
(text-cursor text cursor font)

Graphical elem that can draw a text cursor

font should be a membrane.ui.Font

Graphical elem that can draw a text cursor

font should be a membrane.ui.Font
sourceraw docstring

text-selectionclj/s

(text-selection text [selection-start selection-end :as selection])
(text-selection text [selection-start selection-end :as selection] font)

Graphical elem for drawing a selection of text.

Graphical elem for drawing a selection of text.
sourceraw docstring

TextCursorclj/s

source

TextSelectionclj/s

source

translateclj/s

(translate x y drawable)

A graphical elem that will shift drawable's origin by x and y and draw it at its new origin.

A graphical elem that will shift drawable's origin by x and y and draw it at its new origin.
sourceraw docstring

Translateclj/s

source

vertical-layoutclj/s

(vertical-layout & elems)

Returns a graphical elem of elems stacked on top of each other

Returns a graphical elem of elems stacked on top of each other
sourceraw docstring

widthclj/s

(width elem)

Returns the width of elem.

Returns the width of elem.
sourceraw docstring

with-colorclj/s

(with-color color & drawables)

Use color for all children. Color is a vector of [r g b] or [r g b a]. All values should be between 0 and 1 inclusive.

Use color for all children. Color is a vector of [r g b] or [r g b a]. All values should be between 0 and 1 inclusive.
sourceraw docstring

with-stroke-widthclj/s

(with-stroke-width stroke-width & drawables)

Set the stroke width for drawables.

Set the stroke width for drawables.
sourceraw docstring

with-styleclj/s

(with-style style & drawables)

Style for drawing paths and polygons

style is one of: :membrane.ui/style-fill :membrane.ui/style-stroke :membrane.ui/style-stroke-and-fill

Style for drawing paths and polygons

  style is one of:
:membrane.ui/style-fill
:membrane.ui/style-stroke
:membrane.ui/style-stroke-and-fill
sourceraw docstring

WithColorclj/s

source

WithStrokeWidthclj/s

source

WithStyleclj/s

source

wrapclj

(wrap o)
source

wrap-onclj/s

(wrap-on & events)

Wraps an elem with event handlers.

events are pairs of events and event handlers and the last argument should be an elem. The event handlers should accept an extra first argument to the event which is the original event handler.

example:

Wraps a button with a mouse-down handler that only returns an effect when the x coordinate is even. (on :mouse-down (fn [handler [mx my]] (when (even? mx) (handler [mx my]))) (button "Hello!" (fn [] [[:hello!]])))

Wraps an elem with event handlers.

events are pairs of events and event handlers and the last argument should be an elem.
The event handlers should accept an extra first argument to the event which is the original event handler.

example:

Wraps a button with a mouse-down handler that only returns an effect when the x coordinate is even.
(on :mouse-down (fn [handler [mx my]]
                   (when (even? mx)
                     (handler [mx my])))
   (button "Hello!"
          (fn []
             [[:hello!]])))
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close