Hi Everyone
I'd like to make one button to change position by mouse and resize it
by anchors.
I followed instructions of help documentation but it doesn't work.
Could anybody help me?
My code is as followes.
Thank you very much
···
------------------------------------------------------------------------------------
import wx
from wx.lib.anchors import LayoutAnchors
class MyButton(wx.Button):
def __init__(self, parent, id, label, pos):
wx.Button.__init__(self, parent, id, label, pos)
self.SetConstraints(LayoutAnchors(self, left = 1,top = 1,right
= 1,bottom = 1))
self.SetAutoLayout(True)
#def OnClicked(self, event):
# print 'Event of button control'
class AnchorTest(wx.Frame):
def __init__ (self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size = (250, 150))
panel = wx.Panel(self, -1)
MyButton(panel, -1, 'OK', wx.DefaultPosition)
self.Centre()
self.Show(True)
app = wx.App()
AnchorTest(None, -1, 'Anchortest')
app.MainLoop()