wxPython Boxsizers

Joy Deep c.joydeep at gmail.com
Thu Nov 6 08:50:37 EST 2014


I am using Python 2.7.6
Here is the code I am trying:

import wx

class MyFrame(wx.Frame):
    def __init__(self, *args, **kid's):
        wx.Frame.__init__(self, *args, **kwds)
        self.button_1 = wx.Button(self, wx.ID_ANY, "button_1")
        self.button_2 = wx.Button(self, wx.ID_ANY, "button_2")
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_1.Add(self.button_1, 0, wx.ALL | wx.ALIGN_RIGHT, 1)
        sizer_1.Add(self.button_2, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_BOTTOM, 1)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        self.Layout()

if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    frame_1 = MyFrame(None, wx.ID_ANY, "")
    frame_1.Show()
    app.MainLoop()

Thanks.



On Thursday, November 6, 2014 4:01:53 PM UTC+5:30, Joel Goldstick wrote:
> On Thu, Nov 6, 2014 at 5:13 AM, Jaydip Chakrabarty <c.joydeep at gmail.com> wrote:
> > Hello,
> >
> > I am new to Python. I am learning boxsizer. I want to put two buttons on
> > my panel. One at top right corner and one at bottom right corner. How do
> > I achieve this?
> >
> > Thanks
> 
> First, what version of python.  What is boxsizer?  Show some code of
> what you have tried.
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> 
> 
> 
> -- 
> Joel Goldstick
> http://joelgoldstick.com



More information about the Python-list mailing list