mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-18 20:36:08 +00:00
269 lines
7.0 KiB
Plaintext
269 lines
7.0 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "089cfc9a-ee04-4a75-b519-e1b1ef4c5ed5",
|
|
"metadata": {},
|
|
"source": [
|
|
"The layout widget is a widget that adheres to any other widget"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "3643e44d-0220-46be-867e-8e7781fb7bbe",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<style>/* Styles used for the Hoogle display in the pager */\n",
|
|
".hoogle-doc {\n",
|
|
"display: block;\n",
|
|
"padding-bottom: 1.3em;\n",
|
|
"padding-left: 0.4em;\n",
|
|
"}\n",
|
|
".hoogle-code {\n",
|
|
"display: block;\n",
|
|
"font-family: monospace;\n",
|
|
"white-space: pre;\n",
|
|
"}\n",
|
|
".hoogle-text {\n",
|
|
"display: block;\n",
|
|
"}\n",
|
|
".hoogle-name {\n",
|
|
"color: green;\n",
|
|
"font-weight: bold;\n",
|
|
"}\n",
|
|
".hoogle-head {\n",
|
|
"font-weight: bold;\n",
|
|
"}\n",
|
|
".hoogle-sub {\n",
|
|
"display: block;\n",
|
|
"margin-left: 0.4em;\n",
|
|
"}\n",
|
|
".hoogle-package {\n",
|
|
"font-weight: bold;\n",
|
|
"font-style: italic;\n",
|
|
"}\n",
|
|
".hoogle-module {\n",
|
|
"font-weight: bold;\n",
|
|
"}\n",
|
|
".hoogle-class {\n",
|
|
"font-weight: bold;\n",
|
|
"}\n",
|
|
".get-type {\n",
|
|
"color: green;\n",
|
|
"font-weight: bold;\n",
|
|
"font-family: monospace;\n",
|
|
"display: block;\n",
|
|
"white-space: pre-wrap;\n",
|
|
"}\n",
|
|
".show-type {\n",
|
|
"color: green;\n",
|
|
"font-weight: bold;\n",
|
|
"font-family: monospace;\n",
|
|
"margin-left: 1em;\n",
|
|
"}\n",
|
|
".mono {\n",
|
|
"font-family: monospace;\n",
|
|
"display: block;\n",
|
|
"}\n",
|
|
".err-msg {\n",
|
|
"color: red;\n",
|
|
"font-style: italic;\n",
|
|
"font-family: monospace;\n",
|
|
"white-space: pre;\n",
|
|
"display: block;\n",
|
|
"}\n",
|
|
"#unshowable {\n",
|
|
"color: red;\n",
|
|
"font-weight: bold;\n",
|
|
"}\n",
|
|
".err-msg.in.collapse {\n",
|
|
"padding-top: 0.7em;\n",
|
|
"}\n",
|
|
".highlight-code {\n",
|
|
"white-space: pre;\n",
|
|
"font-family: monospace;\n",
|
|
"}\n",
|
|
".suggestion-warning { \n",
|
|
"font-weight: bold;\n",
|
|
"color: rgb(200, 130, 0);\n",
|
|
"}\n",
|
|
".suggestion-error { \n",
|
|
"font-weight: bold;\n",
|
|
"color: red;\n",
|
|
"}\n",
|
|
".suggestion-name {\n",
|
|
"font-weight: bold;\n",
|
|
"}\n",
|
|
"</style><div class=\"suggestion-name\" style=\"clear:both;\">Unused LANGUAGE pragma</div><div class=\"suggestion-row\" style=\"float: left;\"><div class=\"suggestion-warning\">Found:</div><div class=\"highlight-code\" id=\"haskell\">{-# LANGUAGE OverloadedStrings #-}</div></div><div class=\"suggestion-row\" style=\"float: left;\"><div class=\"suggestion-warning\">Why Not:</div><div class=\"highlight-code\" id=\"haskell\"></div></div>"
|
|
],
|
|
"text/plain": [
|
|
"Line 1: Unused LANGUAGE pragma\n",
|
|
"Found:\n",
|
|
"{-# LANGUAGE OverloadedStrings #-}\n",
|
|
"Why not:"
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"{-# LANGUAGE OverloadedStrings #-}\n",
|
|
"import IHaskell.Display.Widgets\n",
|
|
"import IHaskell.Display.Widgets.Layout\n",
|
|
"import Data.Text as T"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "d8430ed3-0e24-4057-8230-73c47fa75793",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"application/vnd.jupyter.widget-view+json": {
|
|
"model_id": "e3fec42f-c887-4ecf-922d-b4a3754cee5a",
|
|
"version_major": 2,
|
|
"version_minor": 0
|
|
}
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"button <- mkButton\n",
|
|
"setField button Description \"Click me!\"\n",
|
|
"button"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "08d9c91c-8065-4a66-b564-b225e316f379",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"layout <- mkLayout\n",
|
|
"setField button Layout $ Just layout"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"id": "6357dffb-f70e-475e-a007-41211d495042",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"ModelModule ::: Text\n",
|
|
"ModelModuleVersion ::: Text\n",
|
|
"ModelName ::: Text\n",
|
|
"ViewModule ::: Text\n",
|
|
"ViewModuleVersion ::: Text\n",
|
|
"ViewName ::: Text\n",
|
|
"LAlignContent ::: Maybe [Char]\n",
|
|
"LAlignItems ::: Maybe [Char]\n",
|
|
"LAlignSelf ::: Maybe [Char]\n",
|
|
"LBorder ::: Maybe [Char]\n",
|
|
"LBottom ::: Maybe [Char]\n",
|
|
"LDisplay ::: Maybe [Char]\n",
|
|
"LFlex ::: Maybe [Char]\n",
|
|
"LFlexFlow ::: Maybe [Char]\n",
|
|
"LGridArea ::: Maybe [Char]\n",
|
|
"LGridAutoColumns ::: Maybe [Char]\n",
|
|
"LGridAutoFlow ::: Maybe [Char]\n",
|
|
"LGridAutoRows ::: Maybe [Char]\n",
|
|
"LGridColumn ::: Maybe [Char]\n",
|
|
"LGridGap ::: Maybe [Char]\n",
|
|
"LGridRow ::: Maybe [Char]\n",
|
|
"LGridTemplateAreas ::: Maybe [Char]\n",
|
|
"LGridTemplateColumns ::: Maybe [Char]\n",
|
|
"LGridTemplateRows ::: Maybe [Char]\n",
|
|
"LHeight ::: Maybe [Char]\n",
|
|
"LJustifyContent ::: Maybe [Char]\n",
|
|
"LJustifyItems ::: Maybe [Char]\n",
|
|
"LLeft ::: Maybe [Char]\n",
|
|
"LMargin ::: Maybe [Char]\n",
|
|
"LMaxHeight ::: Maybe [Char]\n",
|
|
"LMaxWidth ::: Maybe [Char]\n",
|
|
"LMinHeight ::: Maybe [Char]\n",
|
|
"LMinWidth ::: Maybe [Char]\n",
|
|
"LOrder ::: Maybe [Char]\n",
|
|
"LOverflow ::: Maybe [Char]\n",
|
|
"LOverflowX ::: Maybe [Char]\n",
|
|
"LOverflowY ::: Maybe [Char]\n",
|
|
"LPadding ::: Maybe [Char]\n",
|
|
"LRight ::: Maybe [Char]\n",
|
|
"LTop ::: Maybe [Char]\n",
|
|
"LVisibility ::: Maybe [Char]\n",
|
|
"LWidth ::: Maybe [Char]"
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"properties layout"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"id": "ef00e9aa-3f48-42ff-bb45-9f59b09e78e4",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"application/vnd.jupyter.widget-view+json": {
|
|
"model_id": "e3fec42f-c887-4ecf-922d-b4a3754cee5a",
|
|
"version_major": 2,
|
|
"version_minor": 0
|
|
}
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"setField layout Border $ Just \"3px solid red\"\n",
|
|
"button"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"id": "141277e9-4082-4b93-a597-9f34c4bfcf2c",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"setField layout Visibility $ Just \"unset\""
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Haskell",
|
|
"language": "haskell",
|
|
"name": "haskell"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": "ihaskell",
|
|
"file_extension": ".hs",
|
|
"mimetype": "text/x-haskell",
|
|
"name": "haskell",
|
|
"pygments_lexer": "Haskell",
|
|
"version": "8.10.4"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|