import "pinafore-gnome"

GIO

GNOME file access.

type File.GIO.

A file.

URI.File.GIO. : Text. -> File.GIO.

Construct a file from a URI.

Path.File.GIO. : Text. -> File.GIO.

Construct a file from a local path.

makeRef.File.GIO. : File.GIO. -> Action. (WholeModel. MIME.)

Make a reference from a file.

GTK

User interface, using GTK.

Widget

type Widget.GTK.

A user interface widget is something that goes inside a window.

type Layout.Widget.GTK.

A widget in the context of a layout.

subtype Widget.GTK. <: Layout.Widget.GTK.

exec.Widget.GTK. : Action. Widget.GTK. -> Widget.GTK.

A widget that runs an Action first.

withContext.Widget.GTK. : (Context.GTK. -> Widget.GTK.) -> Widget.GTK.

A widget that requires a Context.

notifySelection.Widget.GTK. : (Action. TextModel. -> Action. Unit.) -> Widget.GTK. -> Widget.GTK.

Notify whenever the selection changes.

owned.Widget.GTK. : Widget.GTK. -> Widget.GTK.

Run actions caused by this widget in the window’s lifecycle.

blank.Widget.GTK. : Widget.GTK.

Blank widget

image.Widget.GTK. : WholeModel. +Image. -> Widget.GTK.

A widget for an image

unitCheckBox.Widget.GTK. : WholeModel. +Text. -> WholeModel. Unit. -> Widget.GTK.

(TBD)

checkBox.Widget.GTK. : WholeModel. +Text. -> WholeModel. Boolean. -> Widget.GTK.

Checkbox. Use shift-click to set to unknown.

textEntry.Widget.GTK. : WholeModel. Text. -> Widget.GTK.

Text entry, unknown reference will be interpreted as empty text, but the widget will not delete the reference.

textArea.Widget.GTK. : TextModel. -> Widget.GTK.

Text area, unknown reference will be interpreted as empty text, but the widget will not delete the reference.

label.Widget.GTK. : WholeModel. +Text. -> Widget.GTK.

Label.

horizontal.Widget.GTK. : List. Layout.Widget.GTK. -> Widget.GTK.

Widgets laid out horizontally.

vertical.Widget.GTK. : List. Layout.Widget.GTK. -> Widget.GTK.

Widgets laid out vertically.

layoutGrow.Widget.GTK. : Layout.Widget.GTK. -> Layout.Widget.GTK.

Allow the widget to expand into remaining space within the layout.

notebook.Widget.GTK. : WholeModel. -Integer. -> List. (Widget.GTK. *: Widget.GTK.) -> Widget.GTK.

A notebook of pages. First of each pair is for the page tab (typically a label), second is the content.

button.Widget.GTK. : WholeModel. +Text. -> WholeModel. +(Action. Any) -> Widget.GTK.

A button with this text that does this action. Button will be disabled if the action reference is unknown.

pick.Widget.GTK. : WholeModel. +(List. ((Entity. & a) *: Text.)) -> WholeModel. {a,+Entity.} -> Widget.GTK.

A drop-down menu.

list.Widget.GTK. : (WholeModel. +a -> Widget.GTK.) -> ListModel. +a -> Widget.GTK.

A dynamic list of widgets.

listTable.Widget.GTK. : List. (WholeModel. +Text. *: (a -> WholeModel. +Text.)) -> ListModel. {+Entity.,+a} -> (a -> Action. Any) -> Maybe. (WholeModel. {a,+Entity.}) -> Widget.GTK.

A list table. First arg is columns (name, property), second is list-reference of items, third is the action for item activation, fourth is an optional reference for the selected row.

calendar.Widget.GTK. : WholeModel. Date. -> Widget.GTK.

A calendar.

scrolled.Widget.GTK. : Widget.GTK. -> Widget.GTK.

A scrollable container.

dynamic.Widget.GTK. : WholeModel. +Widget.GTK. -> Widget.GTK.

A widget that can be updated to different UIs.

name.Widget.GTK. : Text. -> Widget.GTK. -> Widget.GTK.

A widget with name set. You can use something like #text to refer to it in the CSS style-sheet.

styleClass.Widget.GTK. : Text. -> Widget.GTK. -> Widget.GTK.

A widget with CSS class set. You can use something like .text to refer to all widgets in this class in the CSS style-sheet.

styleSheet.Widget.GTK. : WholeModel. +Text. -> Widget.GTK. -> Widget.GTK.

A widget with a CSS style-sheet (applied to the whole tree of widgets). See the GTK+ CSS overview and properties for how this works.

Drawing

type Handler.GTK.

Response to button-clicked events

<>.Handler.GTK. : Handler.GTK. -> Handler.GTK. -> Handler.GTK.

concat1.Handler.GTK. : List1.List. Handler.GTK. -> Handler.GTK.

empty.Handler.GTK. : Handler.GTK.

concat.Handler.GTK. : List. Handler.GTK. -> Handler.GTK.

onClick.Handler.GTK. : Action. Unit. -> Handler.GTK.

Action to perform on click

fallThrough.Handler.GTK. : Handler.GTK. -> Handler.GTK.

Run the handler, but fall through to run handlers underneath.

draw.Widget.GTK. : WholeModel. +(Integer. *: Integer. -> Drawing.Cairo. Handler.GTK.) -> Widget.GTK.

Drawable widget

Windows

type Context.GTK.

Context for GTK

run.GTK. : (Context.GTK. -> Action. a) -> Action. a

Call the provided function with a GTK context, after which run the GTK event loop until all windows are closed.

type Window.GTK.

A user interface window.

open.Window.GTK. : Context.GTK. -> Integer. *: Integer. -> WholeModel. +Text. -> Widget.GTK. -> Action. Window.GTK.

Open a new window with this size, title and widget.

close.Window.GTK. : Window.GTK. -> Action. Unit.

Close a window.

show.Window.GTK. : Window.GTK. -> Action. Unit.

Show a window.

hide.Window.GTK. : Window.GTK. -> Action. Unit.

Hide a window.

exit.GTK. : Context.GTK. -> Action. Unit.

Exit the user interface.

Clipboard

clipboard.GTK. : Context.GTK. -> WholeModel. Literal.

The UI clipboard, for copying and pasting.

Dialogs

chooseExistingFile.GTK. : Context.GTK. -> (Maybe. (Text. *: Text.) -> Boolean.) -> Action. File.GIO.

Run a dialog to choose an existing file.

chooseNewFile.GTK. : Context.GTK. -> (Maybe. (Text. *: Text.) -> Boolean.) -> Action. File.GIO.

Run a dialog to choose a new file.

GTK.Debug

Functions for GTK debugging.

ignoreUpdateUIExceptions.GTK.Debug. : WholeModel. {-p,+q} -> WholeModel. {-p,+q}

Drop exceptions from updates

windowInfo.GTK.Debug. : Window.GTK. -> Action. Text.

Get window contents information

lock.GTK.Debug. : Context.GTK. -> Action. a -> Action. a

Lock GTK