[IPython-dev] Widget example that uses classes instead of globals?
hughesadam87 at gmail.com
Sat Aug 30 13:41:30 EDT 2014
This question follows directly from this recent thread on the feasiblity of
but I thought was specific enough to be a new thread.
In all of the notebook examples I've seen, a GUI is defined in its own cell
with global variables that are shared between functions. I'd really like
to see a complete, simple example of a GUI build as a class, where most of
the events, updates and default values are set within the class. And then
when the class is instantiated, the notebook somehow can still output the
For example, would something of this design be compatible with the current
widget design pattern:
* variable = defaultvalue*
* def update_variable(self):*
* def redraw(self):*
*# Instantiate the class*
*f = Foo()*
Or is this type of design pattern out of the question? We're trying to
move in this direction so that we can compartmentalize and template as much
behavior as possible, and make a simple framework for building up more
complex GUIs. It's just now clear to me if such a pattern is possible. If
anyone has any insights or examples, would you mind sharing?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev