Question

I am buiding a GUI where I have a wxribbon with few pages and on each page, I have few panels with buttons on them. What I want is to allow users to be able to drag panels on a page to reorder them according to their need. I am a newbie to wxpython and I have no idea how to do it. I just need some as guidance as to how to do this. Any help would be great. Thanks. I have attached a simple ribbon code with panels.

self._ribbon = RB.RibbonBar(self, wx.ID_ANY, size = (1368,350), style = RB.RIBBON_BAR_DEFAULT_STYLE | RB.RIBBON_BAR_ALWAYS_SHOW_TABS)

workpiece = RB.RibbonPage(self._ribbon, WORKPIECE, "Workpiece", Bitmap("eye.xpm"))
panel1 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
panel2 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
panel3 = RB.RibbonPanel(workpiece,wx.ID_ANY,"New Block",Bitmap("selection_panel.xpm"))
Was it helpful?

Solution

Unfortunately, that feature is not built-in to wxPython. The closest thing that I am aware of is "dockable" pains in the AUI framework. I would recommend looking at that, especially the pure Python version of AUI that is in wx.lib.agw.aui. You can see an example of its use in the wxPython demo.

I am thinking that you might be able to use a dock from that inside your ribbon control and add docked panes to it that can then be moved around. I'm not sure if this will work the way you expect, but it's the best available without creating something new. Otherwise you will have to create a custom widget.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top