Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 716697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:19:43+00:00 2026-05-14T05:19:43+00:00

Ok, so I’m learning about sizers in wxPython and I was wondering if it

  • 0

Ok, so I’m learning about sizers in wxPython and I was wondering if it was possible to do something like:

==============================================
|WINDOW TITLE                          _ [] X|
|============================================|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxNOTEBOOKxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|________                         ___________|
|IMAGE   |                       |LoginForm  |
|________|                       |___________|
==============================================

NOTE:Yeah, I literally got this from wxPython – picking the right sizer to use in an application

With NOTEBOOK expanded to left and bottom, IMAGE to align to left and bottom and loginform align to right and bottom and I managed to do almost everything but now I have a problem..

The problem is that I can’t align Loginform and Image separately (im using Box Sizers), and I would like to.

EDIT: So everyone can see what I mean:
“Oh and what I was referring to, was basically that if I changed the align, it would affect both LoginForm and Image.. For example if I set the align to RIGHT, both image and loginform would have been aligned to the right because of: sizer.Add(sizer4,0, wx.ALIGN_RIGHT | wx.RIGHT, 10). Hope you guys can understand this time”

This is the code I’m using that is causing the problem at the moment, any help is appreciated.
NOTE:The code might be (HUGELY) sloppy as I’m still learning box sizers.
Heres a test code:

import wx
class Sizerframe(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'sizertestframe',size=(790, 524))
        p = wx.Panel(self)
        nb = wx.Notebook(p, size = (750, 332))
        button = wx.Button(p, -1, "loginform1rest", size=(94,23))
        button1 = wx.Button(p, -1, "Login", size=(94,23))
        button2 = wx.Button(p, -1, "Cancel", size=(94,23))
        imagebutton = wx.Button(p, -1, "imagebutton", size=(94,23))



        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer1 = wx.BoxSizer(wx.HORIZONTAL)
        sizer1.Add(nb,1, wx.EXPAND)
        sizer.Add(sizer1,1, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
        sizer.Add((-1, 25))
        sizer2 = wx.BoxSizer(wx.VERTICAL)
        sizer2.Add(button, 0)
        sizer3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer3.Add(button1, 0)
        sizer3.Add(button2,0, wx.LEFT, 5)
        sizer2.Add(sizer3, 0)

        sizer4 = wx.BoxSizer(wx.HORIZONTAL)
        sizer4.Add(imagebutton, 1, wx.LEFT | wx.BOTTOM)
        sizer4.Add(sizer2,0, wx.RIGHT | wx.BOTTOM , 5)
        sizer.Add(sizer4,0, wx.ALIGN_RIGHT | wx.RIGHT, 10)
        p.SetSizer(sizer)

def main():
    app = wx.App()
    frame = Sizerframe()
    frame.Show()
    app.MainLoop()
if __name__ == '__main__':
    main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:19:44+00:00Added an answer on May 14, 2026 at 5:19 am

    How about something like this?

    container = wx.BoxSizer(wx.VERTICAL)
    container.Add(self.nb, 1, wx.EXPAND)
    
    login = wx.BoxSizer(wx.VERTICAL)
    login.Add(self.userLabel)
    login.Add(self.userText)
    
    # ... clip, rest of login form additions here
    
    bottom = wx.BoxSizer(wx.HORIZONTAL)
    bottom.Add(image)
    bottom.Add((0, 0), 1, wx.EXPAND)
    bottom.Add(login)
    
    container.Add(bottom, 1, wx.EXPAND)
    

    Basically, the bottom.Add((0, 0), 1, wx.EXPAND) will act as a spacer that’ll take up all the space between the image and the login form. I didn’t really understand what you meant by “The problem is that I can’t align Loginform and Image separately (im using Box Sizers), and I would like to”. I mostly just followed the illustration in trying to create a layout. I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 357k
  • Answers 357k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.