Commit 62105278 authored by Guillaume Seguin's avatar Guillaume Seguin

More fixes to custom buttons handling

parent ef83ee0e
...@@ -726,6 +726,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -726,6 +726,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
allcbs = getattr(self, "custombuttonbuttons", []) allcbs = getattr(self, "custombuttonbuttons", [])
for button in allcbs: for button in allcbs:
self.centersizer.Detach(button) self.centersizer.Detach(button)
button.Destroy()
self.custombuttonbuttons = [] self.custombuttonbuttons = []
custombuttons = self.custombuttons[:] + [None] custombuttons = self.custombuttons[:] + [None]
for i, btndef in enumerate(custombuttons): for i, btndef in enumerate(custombuttons):
...@@ -756,6 +757,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -756,6 +757,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
b.Bind(wx.EVT_MOUSE_EVENTS, self.editbutton) b.Bind(wx.EVT_MOUSE_EVENTS, self.editbutton)
self.custombuttonbuttons.append(b) self.custombuttonbuttons.append(b)
self.centersizer.Add(b, pos = (i // 4, i % 4)) self.centersizer.Add(b, pos = (i // 4, i % 4))
self.centersizer.Layout()
def help_button(self): def help_button(self):
print _('Defines custom button. Usage: button <num> "title" [/c "colour"] command') print _('Defines custom button. Usage: button <num> "title" [/c "colour"] command')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment