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


Groups > comp.lang.python > #80332

Re: wxPython Boxsizers

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; '"__main__":': 0.09; '*args,': 0.09; '__name__': 0.09; 'buttons': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'rush': 0.09; 'python': 0.11; 'def': 0.12; '**kwds)': 0.16; '>on': 0.16; 'horizontally': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'app': 0.19; 'thu,': 0.19; 'this?': 0.23; 'lets': 0.24; 'url:home': 0.24; 'first,': 0.26; 'distribute': 0.26; 'header:X-Complaints-To:1': 0.27; 'am,': 0.29; 'url:mailman': 0.30; 'code': 0.31; '"")': 0.31; 'url:python': 0.33; 'skip:_ 10': 0.34; 'maybe': 0.34; 'something': 0.35; 'version': 0.36; 'url:listinfo': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'two': 0.37; 'level': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'url:mail': 0.40; 'how': 0.40; 'new': 0.61; 'show': 0.63; 'bottom': 0.67; 'column.': 0.84; 'joel': 0.91; 'panel.': 0.91; 'have.': 0.93; 'received:108': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: wxPython Boxsizers
Date Thu, 06 Nov 2014 09:15:14 -0500
Organization IISS Elusive Unicorn
References <m3fhkk$l3v$1@dont-email.me> <mailman.15541.1415269863.18130.python-list@python.org> <bc723af8-8643-4752-a904-c70096966439@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-108-73-118-23.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 6.00/32.1186
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15545.1415283327.18130.python-list@python.org> (permalink)
Lines 75
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1415283327 news.xs4all.nl 2902 [2001:888:2000:d::a6]:40636
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80332

Show key headers only | View raw


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/

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web