wxpython : button covers all in the frame
Posted
by
Prakash
on Stack Overflow
See other posts from Stack Overflow
or by Prakash
Published on 2013-11-05T09:34:58Z
Indexed on
2013/11/05
9:53 UTC
Read the original article
Hit count: 184
Below is my code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import wx
class Example(wx.Frame):
def __init__(self):
#super(Example, self).__init__(parent, title=title, size=(300, 200))
wx.Frame.__init__(self, None, wx.ID_ANY, 'wxButton', pos=(300, 150), size=(320, 250))
self.button1 = wx.Button(self, id=-1, label='Button1', pos=(8, 8), size=(10, 20))
self.button1.Bind(wx.EVT_BUTTON, self.button1Click)
self.Centre()
self.Show()
def button1Click(self,event):
#self.button1.Hide()
self.SetTitle("Button1 clicked")
if __name__ == '__main__':
app = wx.App()
Example()
app.MainLoop()
Actually I am expecting the button1 on the frame to have a look like a button - a bit raised and be placed in center of frame - but it is just expanding to the full frame. Also text Button1 looks like a text which does not has a button look like feeling?
What wrong am I doing?
© Stack Overflow or respective owner