From 25a7a738cebec004a2ff282323a052c192530369 Mon Sep 17 00:00:00 2001 From: jlstevens Date: Tue, 18 Oct 2016 14:26:13 +0100 Subject: [PATCH] Added display option to Widgets --- paramnb/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/paramnb/__init__.py b/paramnb/__init__.py index 4f5e275..fb0bc6a 100644 --- a/paramnb/__init__.py +++ b/paramnb/__init__.py @@ -177,8 +177,12 @@ class Widgets(param.ParameterizedFunction): layout = param.ObjectSelector(default='column', objects=['row','column'],doc=""" Whether to lay out the buttons as a row or a column.""") - - + + display = param.Boolean(default=True, doc=""" + Whether or not to display the widgets. Useful for batch running + notebooks.""") + + def __call__(self, parameterized, **params): @@ -193,7 +197,8 @@ def __call__(self, parameterized, **params): layout = ipywidgets.Layout(display='flex', flex_flow=self.p.layout) vbox = ipywidgets.VBox(children=widgets, layout=layout) - display(vbox) + if self.p.display: + display(vbox) if self.p.on_init: self.execute(None)