Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80326 > unrolled thread

wxPython Boxsizers

Started byJaydip Chakrabarty <c.joydeep@gmail.com>
First post2014-11-06 10:13 +0000
Last post2014-11-06 10:41 +0000
Articles 5 — 5 participants

Back to article view | Back to comp.lang.python


Contents

  wxPython Boxsizers Jaydip Chakrabarty <c.joydeep@gmail.com> - 2014-11-06 10:13 +0000
    Re: wxPython Boxsizers Joel Goldstick <joel.goldstick@gmail.com> - 2014-11-06 05:31 -0500
      Re: wxPython Boxsizers Joy Deep <c.joydeep@gmail.com> - 2014-11-06 05:50 -0800
        Re: wxPython Boxsizers Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-06 09:15 -0500
    Re: wxPython Boxsizers Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-06 10:41 +0000

#80326 — wxPython Boxsizers

FromJaydip Chakrabarty <c.joydeep@gmail.com>
Date2014-11-06 10:13 +0000
SubjectwxPython Boxsizers
Message-ID<m3fhkk$l3v$1@dont-email.me>
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

[toc] | [next] | [standalone]


#80328

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2014-11-06 05:31 -0500
Message-ID<mailman.15541.1415269863.18130.python-list@python.org>
In reply to#80326
On Thu, Nov 6, 2014 at 5:13 AM, Jaydip Chakrabarty <c.joydeep@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

[toc] | [prev] | [next] | [standalone]


#80331

FromJoy Deep <c.joydeep@gmail.com>
Date2014-11-06 05:50 -0800
Message-ID<bc723af8-8643-4752-a904-c70096966439@googlegroups.com>
In reply to#80328
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@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

[toc] | [prev] | [next] | [standalone]


#80332

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2014-11-06 09:15 -0500
Message-ID<mailman.15545.1415283327.18130.python-list@python.org>
In reply to#80331
On Thu, 6 Nov 2014 05:50:37 -0800 (PST), Joy Deep <c.joydeep@gmail.com>
declaimed the following:

>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()
>

	http://www.wxpython.org/docs/api/wx.BoxSizer-class.html

	As I understand it, a "vertical" box-sizer lets you distribute the
contents in a column. To position things horizontally will require some
higher level sizer to position the one one you have.

	Maybe something like (rough pseudo code -- I need to rush to go to
work)

	sh = sizer(horizontal)
	svl = sizer(vertical)
	svr = sizer(vertical)
	sh.add(svl, align_left)
	sh.add(svr, align_right)
	b1 = button()
	b2 = button()
	svr.add(b1, align_top)
	svr.add(b2, align_bottom)


>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@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
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#80329

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-11-06 10:41 +0000
Message-ID<mailman.15542.1415270493.18130.python-list@python.org>
In reply to#80326
On 06/11/2014 10:13, Jaydip Chakrabarty 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
>

Probably best asked here 
https://groups.google.com/forum/#!forum/wxpython-users also available as 
http://news.gmane.org/gmane.comp.python.wxpython

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web