I want to integrate IntRangeSlider from ipywidgets with wxpython dekstop application. I tried using widgets.IntRangeSlider() and interact() both separately but program is not executing. How to use these excellent functionalities with wx?
Official page of ipywidgets with examples
import wx
from ipywidgets import *
class MyPanel(wx.Panel):
def __init__(self, parent):
"""Constructor"""
wx.Panel.__init__(self, parent)
self.vert_box = wx.BoxSizer(wx.VERTICAL)
rangeslider = widgets.IntRangeSlider(
value=[5, 7],
min=0,
max=10,
step=1,
description='Test:',
disabled=False,
continuous_update=False,
orientation='horizontal',
readout=True,
readout_format='d',
)
self.vert_box.Add(rangeslider, 0, wx.ALIGN_CENTER | wx.ALL, 1)
rangeslider2= interact(self.update)
self.vert_box.Add(rangeslider2, 0, wx.ALIGN_CENTER | wx.ALL, 1)
self.SetSizer(self.vert_box)
self.Refresh()
def update(self, w = 1.0):
print("here is slider code")
class MyFrame(wx.Frame):
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, title='Test', size=(750, 550))
panel = MyPanel(self)
self.Show()
if __name__ == '__main__':
app = wx.App(False)
frame = MyFrame()
app.MainLoop()