Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
3a2228d2
Commit
3a2228d2
authored
Jul 22, 2015
by
Sumit Sahrawat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment on console input issue
Explain reasons for widget's inability to use stdin.
parent
73446ed7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
MsgSpec.md
ihaskell-display/ihaskell-widgets/MsgSpec.md
+13
-1
Types.hs
...ay/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
+3
-1
No files found.
ihaskell-display/ihaskell-widgets/MsgSpec.md
View file @
3a2228d2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
> Largely based on: https://github.com/ipython/ipython/wiki/IPEP-23:-Backbone.js-Widgets
> Largely based on: https://github.com/ipython/ipython/wiki/IPEP-23:-Backbone.js-Widgets
> The messaging specification as detailed is riddled with assumptions
IHaskell's
widget
> The messaging specification as detailed is riddled with assumptions
the IHaskell
widget
> implementation makes. It works for us, so it should work for everyone.
> implementation makes. It works for us, so it should work for everyone.
## Creating widgets
## Creating widgets
...
@@ -101,6 +101,18 @@ two possible formats:
...
@@ -101,6 +101,18 @@ two possible formats:
This form is generally used to notify the kernel about events. For example, the
`TextWidget`
sends a
This form is generally used to notify the kernel about events. For example, the
`TextWidget`
sends a
custom message when the text is submitted by hitting the 'Enter' key.
custom message when the text is submitted by hitting the 'Enter' key.
## The issue with console input
Whenever the kernel needs to fetch input from the stdin, an
`input_request`
message is sent to the
frontend. The format for this message requires that this message be sent in response to an
`execute_request`
, which is sent by the frontend whenever a cell is executed.
If this were not so, the frontend would not be able to determine under which cell to place the text
input widget, when an
`input_request`
is received.
Now, widgets cannot send
`execute_request`
messages. They can only send
`comm_data`
messages, which
means that it's not possible to fetch input through widget events.
---
---
*NOTE*
: It's important that the messages sent on the comm are in response to an execution message
*NOTE*
: It's important that the messages sent on the comm are in response to an execution message
...
...
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs
View file @
3a2228d2
...
@@ -51,7 +51,9 @@ module IHaskell.Display.Widgets.Types where
...
@@ -51,7 +51,9 @@ module IHaskell.Display.Widgets.Types where
--
--
-- To know more about the IPython messaging specification (as implemented in this package) take a look
-- To know more about the IPython messaging specification (as implemented in this package) take a look
-- at the supplied MsgSpec.md.
-- at the supplied MsgSpec.md.
--
-- Widgets are not able to do console input, the reason for that can also be found in the messaging
-- specification
import
Control.Monad
(
unless
,
join
,
when
,
void
)
import
Control.Monad
(
unless
,
join
,
when
,
void
)
import
Control.Applicative
((
<$>
))
import
Control.Applicative
((
<$>
))
import
qualified
Control.Exception
as
Ex
import
qualified
Control.Exception
as
Ex
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment