Commit 67ab446e authored by David Davó's avatar David Davó

Added widgets styles

parent abf2a721
......@@ -21,6 +21,8 @@ jupyter nbconvert *.ipynb --to notebook --inplace --clear-output
- [ ] Make the `output` widget work
- [ ] Processing of widget messages concurrently
- [ ] Make the layout widget values more 'Haskelian': Instead of checking if the string is valid at runtime, make some types so it's checked at compile-time
- [ ] Create a serializable color data type instead of using `Maybe String`
- [ ] Overload setField so it can be used with `Maybes` without having to put `Just` every time
- [ ] Add some "utils" work:
- [ ] Create media widget from file
- [ ] Get the selected label from a selection value
\ No newline at end of file
......@@ -108,6 +108,9 @@ library
IHaskell.Display.Widgets.String.TextArea
IHaskell.Display.Widgets.Style.ButtonStyle
IHaskell.Display.Widgets.Style.DescriptionStyle
IHaskell.Display.Widgets.Style.ProgressStyle
IHaskell.Display.Widgets.Style.SliderStyle
IHaskell.Display.Widgets.Style.ToggleButtonsStyle
IHaskell.Display.Widgets.Layout.Common
IHaskell.Display.Widgets.Layout.LayoutWidget
......
......@@ -57,6 +57,9 @@ import IHaskell.Display.Widgets.String.TextArea as X
import IHaskell.Display.Widgets.Style.ButtonStyle as X
import IHaskell.Display.Widgets.Style.DescriptionStyle as X
import IHaskell.Display.Widgets.Style.ProgressStyle as X
import IHaskell.Display.Widgets.Style.SliderStyle as X
import IHaskell.Display.Widgets.Style.ToggleButtonsStyle as X
import IHaskell.Display.Widgets.Common as X
import IHaskell.Display.Widgets.Types as X (setField, getField, properties, triggerDisplay,
......
......@@ -40,7 +40,7 @@ mkCheckBox = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boolAttrs = defaultBoolWidget "CheckboxView" "CheckboxModel" layout dstyle
let boolAttrs = defaultBoolWidget "CheckboxView" "CheckboxModel" layout $ StyleWidget dstyle
checkBoxAttrs = (Indent =:: True)
:& RNil
widgetState = WidgetState $ boolAttrs <+> checkBoxAttrs
......
......@@ -40,7 +40,7 @@ mkToggleButton = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boolState = defaultBoolWidget "ToggleButtonView" "ToggleButtonModel" layout dstyle
let boolState = defaultBoolWidget "ToggleButtonView" "ToggleButtonModel" layout $ StyleWidget dstyle
toggleState = (Icon =:: "")
:& (ButtonStyle =:: DefaultButton)
:& RNil
......
......@@ -39,7 +39,7 @@ mkValidWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boolState = defaultBoolWidget "ValidView" "ValidModel" layout dstyle
let boolState = defaultBoolWidget "ValidView" "ValidModel" layout $ StyleWidget dstyle
validState = (ReadOutMsg =:: "") :& RNil
widgetState = WidgetState $ boolState <+> validState
......
......@@ -38,14 +38,12 @@ mkButton = do
-- Default properties, with a random uuid
wid <- U.random
layout <- mkLayout
dstyle <- mkDescriptionStyle
btnstyle <- mkButtonStyle
let ddw = defaultDescriptionWidget "ButtonView" "ButtonModel" layout dstyle
let ddw = defaultDescriptionWidget "ButtonView" "ButtonModel" layout $ StyleWidget btnstyle
but = (Disabled =:: False)
:& (Icon =:: "")
:& (ButtonStyle =:: DefaultButton)
:& (StyleButton =:: btnstyle)
:& (ClickHandler =:: return ())
:& RNil
buttonState = WidgetState (ddw <+> but)
......
......@@ -39,7 +39,7 @@ mkColorPicker = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let ddw = defaultDescriptionWidget "ColorPickerView" "ColorPickerModel" layout dstyle
let ddw = defaultDescriptionWidget "ColorPickerView" "ColorPickerModel" layout $ StyleWidget dstyle
color = (StringValue =:: "black")
:& (Concise =:: False)
:& (Disabled =:: False)
......
......@@ -111,13 +111,10 @@ pattern Axes = S.SAxes
pattern ButtonColor = S.SButtonColor
pattern FontWeight = S.SFontWeight
pattern DescriptionWidth = S.SDescriptionWidth
pattern StyleButton = S.SStyleButton
pattern StyleDescription = S.SStyleDescription
pattern StyleProgress = S.SStyleProgress
pattern StyleSlider = S.SStyleSlider
pattern StyleToggleButton = S.SStyleToggleButton
pattern BarColor = S.SBarColor
pattern HandleColor = S.SHandleColor
pattern ButtonWidth = S.SButtonWidth
pattern Style = S.SStyle
-- | Close a widget's comm
closeWidget :: IHaskellWidget w => w -> IO ()
closeWidget w = widgetSendClose w emptyObject
......
......@@ -41,7 +41,7 @@ mkDatePicker = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let ddw = defaultDescriptionWidget "DatePickerView" "DatePickerModel" layout dstyle
let ddw = defaultDescriptionWidget "DatePickerView" "DatePickerModel" layout $ StyleWidget dstyle
date = (DateValue =:: defaultDate)
:& (Disabled =:: False)
:& RNil
......
......@@ -41,7 +41,7 @@ mkBoundedFloatText = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatWidget "FloatTextView" "BoundedFloatTextModel" layout dstyle
let boundedFloatAttrs = defaultBoundedFloatWidget "FloatTextView" "BoundedFloatTextModel" layout $ StyleWidget dstyle
textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False)
:& (StepFloat =:: Nothing)
......
......@@ -41,7 +41,7 @@ mkFloatLogSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedLogFloatAttrs = defaultBoundedLogFloatWidget "FloatLogSliderView" "FloatLogSliderModel" layout dstyle
let boundedLogFloatAttrs = defaultBoundedLogFloatWidget "FloatLogSliderView" "FloatLogSliderModel" layout $ StyleWidget dstyle
sliderAttrs = (StepFloat =:: Just 0.1)
:& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
......
......@@ -26,7 +26,7 @@ import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common
import IHaskell.Display.Widgets.Layout.LayoutWidget
import IHaskell.Display.Widgets.Style.DescriptionStyle
import IHaskell.Display.Widgets.Style.ProgressStyle
-- | 'FloatProgress' represents an FloatProgress widget from IPython.html.widgets.
type FloatProgress = IPythonWidget 'FloatProgressType
......@@ -37,9 +37,9 @@ mkFloatProgress = do
-- Default properties, with a random uuid
wid <- U.random
layout <- mkLayout
dstyle <- mkDescriptionStyle
pstyle <- mkProgressStyle
let boundedFloatAttrs = defaultBoundedFloatWidget "ProgressView" "FloatProgressModel" layout dstyle
let boundedFloatAttrs = defaultBoundedFloatWidget "ProgressView" "FloatProgressModel" layout $ StyleWidget pstyle
progressAttrs = (Orientation =:: HorizontalOrientation)
:& (BarStyle =:: DefaultBar)
:& RNil
......
......@@ -41,7 +41,7 @@ mkFloatSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatWidget "FloatSliderView" "FloatSliderModel" layout dstyle
let boundedFloatAttrs = defaultBoundedFloatWidget "FloatSliderView" "FloatSliderModel" layout $ StyleWidget dstyle
sliderAttrs = (StepFloat =:: Just 0.1)
:& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
......
......@@ -42,7 +42,7 @@ mkFloatRangeSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedFloatAttrs = defaultBoundedFloatRangeWidget "FloatRangeSliderView" "FloatRangeSliderModel" layout dstyle
let boundedFloatAttrs = defaultBoundedFloatRangeWidget "FloatRangeSliderView" "FloatRangeSliderModel" layout $ StyleWidget dstyle
sliderAttrs = (StepFloat =:: Just 0.1)
:& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
......
......@@ -41,7 +41,7 @@ mkFloatText = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let floatAttrs = defaultFloatWidget "FloatTextView" "FloatTextModel" layout dstyle
let floatAttrs = defaultFloatWidget "FloatTextView" "FloatTextModel" layout $ StyleWidget dstyle
textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False)
:& (StepFloat =:: Nothing)
......
......@@ -41,7 +41,7 @@ mkBoundedIntText = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout dstyle
let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout $ StyleWidget dstyle
textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False)
:& (StepInt =:: Just 1)
......
......@@ -39,7 +39,7 @@ mkIntProgress = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "ProgressView" "IntProgressModel" layout dstyle
let boundedIntAttrs = defaultBoundedIntWidget "ProgressView" "IntProgressModel" layout $ StyleWidget dstyle
progressAttrs = (Orientation =:: HorizontalOrientation)
:& (BarStyle =:: DefaultBar)
:& RNil
......
......@@ -41,7 +41,7 @@ mkIntSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "IntSliderView" "IntSliderModel" layout dstyle
let boundedIntAttrs = defaultBoundedIntWidget "IntSliderView" "IntSliderModel" layout $ StyleWidget dstyle
sliderAttrs = (StepInt =:: Just 1)
:& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
......
......@@ -41,7 +41,7 @@ mkPlay = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntWidget "PlayView" "PlayModel" layout dstyle
let boundedIntAttrs = defaultBoundedIntWidget "PlayView" "PlayModel" layout $ StyleWidget dstyle
playAttrs = (Playing =:: True)
:& (Repeat =:: True)
:& (Interval =:: 100)
......
......@@ -42,7 +42,7 @@ mkIntRangeSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let boundedIntAttrs = defaultBoundedIntRangeWidget "IntRangeSliderView" "IntRangeSliderModel" layout dstyle
let boundedIntAttrs = defaultBoundedIntRangeWidget "IntRangeSliderView" "IntRangeSliderModel" layout $ StyleWidget dstyle
sliderAttrs = (StepInt =:: Just 1)
:& (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
......
......@@ -41,7 +41,7 @@ mkIntText = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let intAttrs = defaultIntWidget "IntTextView" "IntTextModel" layout dstyle
let intAttrs = defaultIntWidget "IntTextView" "IntTextModel" layout $ StyleWidget dstyle
textAttrs = (Disabled =:: False)
:& (ContinuousUpdate =:: False)
:& (StepInt =:: Just 1)
......
......@@ -41,7 +41,7 @@ mkDropdown = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultSelectionWidget "DropdownView" "DropdownModel" layout dstyle
let widgetState = WidgetState $ defaultSelectionWidget "DropdownView" "DropdownModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -40,7 +40,7 @@ mkRadioButtons = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultSelectionWidget "RadioButtonsView" "RadioButtonsModel" layout dstyle
let widgetState = WidgetState $ defaultSelectionWidget "RadioButtonsView" "RadioButtonsModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -41,7 +41,7 @@ mkSelect = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout dstyle
let selectionAttrs = defaultSelectionWidget "SelectView" "SelectModel" layout $ StyleWidget dstyle
selectAttrs = (Rows =:: Just 5)
:& RNil
widgetState = WidgetState $ selectionAttrs <+> selectAttrs
......
......@@ -42,7 +42,7 @@ mkSelectMultiple = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let multipleSelectionAttrs = defaultMultipleSelectionWidget "SelectMultipleView" "SelectMultipleModel" layout dstyle
let multipleSelectionAttrs = defaultMultipleSelectionWidget "SelectMultipleView" "SelectMultipleModel" layout $ StyleWidget dstyle
selectMultipleAttrs = (Rows =:: Just 5)
:& RNil
widgetState = WidgetState $ multipleSelectionAttrs <+> selectMultipleAttrs
......
......@@ -41,7 +41,7 @@ mkSelectionRangeSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultMultipleSelectionWidget "SelectionRangeSliderView" "SelectionRangeSliderModel" layout dstyle
let selectionAttrs = defaultMultipleSelectionWidget "SelectionRangeSliderView" "SelectionRangeSliderModel" layout $ StyleWidget dstyle
selectionRangeSliderAttrs = (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
:& (ContinuousUpdate =:: True)
......
......@@ -40,7 +40,7 @@ mkSelectionSlider = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionNonemptyWidget "SelectionSliderView" "SelectionSliderModel" layout dstyle
let selectionAttrs = defaultSelectionNonemptyWidget "SelectionSliderView" "SelectionSliderModel" layout $ StyleWidget dstyle
selectionSliderAttrs = (Orientation =:: HorizontalOrientation)
:& (ReadOut =:: True)
:& (ContinuousUpdate =:: True)
......
......@@ -41,7 +41,7 @@ mkToggleButtons = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let selectionAttrs = defaultSelectionWidget "ToggleButtonsView" "ToggleButtonsModel" layout dstyle
let selectionAttrs = defaultSelectionWidget "ToggleButtonsView" "ToggleButtonsModel" layout $ StyleWidget dstyle
toggleButtonsAttrs = (Tooltips =:: [])
:& (Icons =:: [])
:& (ButtonStyle =:: DefaultButton)
......
......@@ -119,12 +119,10 @@ singletons
| ButtonColor
| FontWeight
| DescriptionWidth
-- Singletons for child style widgets
| StyleButton
| StyleDescription
| StyleProgress
| StyleSlider
| StyleToggleButton
| BarColor
| HandleColor
| ButtonWidth
| Style
-- Now the ones for layout
-- Every layout property comes with an L before the name to avoid conflict
-- The patterns from Layout.Common remove that leading L
......
......@@ -40,7 +40,7 @@ mkComboboxWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let txtWidget = defaultTextWidget "ComboboxView" "ComboboxModel" layout dstyle
let txtWidget = defaultTextWidget "ComboboxView" "ComboboxModel" layout $ StyleWidget dstyle
boxWidget = (Options =:: [])
:& (EnsureOption =:: False)
:& RNil
......
......@@ -37,7 +37,7 @@ mkHTMLWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultStringWidget "HTMLView" "HTMLModel" layout dstyle
let widgetState = WidgetState $ defaultStringWidget "HTMLView" "HTMLModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -37,7 +37,7 @@ mkHTMLMathWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultStringWidget "HTMLMathView" "HTMLMathModel" layout dstyle
let widgetState = WidgetState $ defaultStringWidget "HTMLMathView" "HTMLMathModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -37,7 +37,7 @@ mkLabelWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultStringWidget "LabelView" "LabelModel" layout dstyle
let widgetState = WidgetState $ defaultStringWidget "LabelView" "LabelModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -40,7 +40,7 @@ mkPasswordWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultTextWidget "PasswordView" "PasswordModel" layout dstyle
let widgetState = WidgetState $ defaultTextWidget "PasswordView" "PasswordModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -40,7 +40,7 @@ mkTextWidget = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let widgetState = WidgetState $ defaultTextWidget "TextView" "TextModel" layout dstyle
let widgetState = WidgetState $ defaultTextWidget "TextView" "TextModel" layout $ StyleWidget dstyle
stateIO <- newIORef widgetState
......
......@@ -39,7 +39,7 @@ mkTextArea = do
layout <- mkLayout
dstyle <- mkDescriptionStyle
let strAttrs = defaultStringWidget "TextareaView" "TextareaModel" layout dstyle
let strAttrs = defaultStringWidget "TextareaView" "TextareaModel" layout $ StyleWidget dstyle
wgtAttrs = (Rows =:: Nothing)
:& (Disabled =:: False)
:& (ContinuousUpdate =:: True)
......
......@@ -34,10 +34,8 @@ mkDescriptionStyle :: IO DescriptionStyle
mkDescriptionStyle = do
wid <- U.random
let stl = defaultStyleWidget "DescriptionStyleModel"
but = (DescriptionWidth =:: "")
:& RNil
btnStlState = WidgetState (stl <+> but)
let stl = defaultDescriptionStyleWidget "DescriptionStyleModel"
btnStlState = WidgetState stl
stateIO <- newIORef btnStlState
......
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Style.ProgressStyle
( -- * Progress style
ProgressStyle
-- * Create a new progress style
, mkProgressStyle
) where
-- To keep `cabal repl` happy when running from the ihaskell repo
import Prelude
import Data.Aeson
import Data.IORef (newIORef)
import Data.Vinyl (Rec(..), (<+>))
import IHaskell.Display
import IHaskell.Eval.Widgets
import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common
-- | A 'ProgressStyle' represents a Button Style from IPython.html.widgets.
type ProgressStyle = IPythonWidget 'ProgressStyleType
-- | Create a new button style
mkProgressStyle :: IO ProgressStyle
mkProgressStyle = do
wid <- U.random
let stl = defaultDescriptionStyleWidget "ProgressStyleModel"
but = (BarColor =:: Nothing)
:& RNil
btnStlState = WidgetState (stl <+> but)
stateIO <- newIORef btnStlState
let style = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen style $ toJSON btnStlState
-- Return the style widget
return style
instance IHaskellWidget ProgressStyle where
getCommUUID = uuid
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Style.SliderStyle
( -- * Slider style
SliderStyle
-- * Create a new slider style
, mkSliderStyle
) where
-- To keep `cabal repl` happy when running from the ihaskell repo
import Prelude
import Data.Aeson
import Data.IORef (newIORef)
import Data.Vinyl (Rec(..), (<+>))
import IHaskell.Display
import IHaskell.Eval.Widgets
import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common
-- | A 'SliderStyle' represents a Button Style from IPython.html.widgets.
type SliderStyle = IPythonWidget 'SliderStyleType
-- | Create a new button style
mkSliderStyle :: IO SliderStyle
mkSliderStyle = do
wid <- U.random
let stl = defaultDescriptionStyleWidget "SliderStyleModel"
but = (HandleColor =:: Nothing)
:& RNil
btnStlState = WidgetState (stl <+> but)
stateIO <- newIORef btnStlState
let style = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen style $ toJSON btnStlState
-- Return the style widget
return style
instance IHaskellWidget SliderStyle where
getCommUUID = uuid
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module IHaskell.Display.Widgets.Style.ToggleButtonsStyle
( -- * ToggleButtons style
ToggleButtonsStyle
-- * Create a new toggle buttons style
, mkToggleButtonsStyle
) where
-- To keep `cabal repl` happy when running from the ihaskell repo
import Prelude
import Data.Aeson
import Data.IORef (newIORef)
import Data.Vinyl (Rec(..), (<+>))
import IHaskell.Display
import IHaskell.Eval.Widgets
import IHaskell.IPython.Message.UUID as U
import IHaskell.Display.Widgets.Types
import IHaskell.Display.Widgets.Common
-- | A 'ToggleButtonsStyle' represents a Button Style from IPython.html.widgets.
type ToggleButtonsStyle = IPythonWidget 'ToggleButtonsStyleType
-- | Create a new button style
mkToggleButtonsStyle :: IO ToggleButtonsStyle
mkToggleButtonsStyle = do
wid <- U.random
let stl = defaultDescriptionStyleWidget "ToggleButtonsStyleModel"
but = (ButtonWidth =:: "")
:& (FontWeight =:: DefaultWeight)
:& RNil
btnStlState = WidgetState (stl <+> but)
stateIO <- newIORef btnStlState
let style = IPythonWidget wid stateIO
-- Open a comm for this widget, and store it in the kernel state
widgetSendOpen style $ toJSON btnStlState
-- Return the style widget
return style
instance IHaskellWidget ToggleButtonsStyle where
getCommUUID = uuid
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment