You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/yjs-widget-controls/notebooks/simple.ipynb
+33-1Lines changed: 33 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,38 @@
86
86
"source": [
87
87
"w.max = 200"
88
88
]
89
+
},
90
+
{
91
+
"cell_type": "code",
92
+
"id": "952ece55",
93
+
"source": "from ypywidgets import Reactive\nfrom ypywidgets.comm import CommWidget\n\n\nclass Textarea(CommWidget):\n value = Reactive[str](\"\")\n rows = Reactive[int](4)\n disabled = Reactive[bool](False)\n continuous_update = Reactive[bool](True)\n\n @value.watch\n def _watch_value(self, old, new):\n # Watch the value of the textarea, and print the new value change\n #\n # From JupyterLab, show the log console with info level to see the print\n # \"Ctrl + Shift + C\" then type \"Log Console\" to expand that panel\n print(f\"value changed: '{old}'->'{new}'\")",
0 commit comments