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

  • SEARCH
  • Home
  • 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 7575073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:35:43+00:00 2026-05-30T16:35:43+00:00

Please help! Info – Program: A pop up frame representing an email message, generated

  • 0

Please help! Info –

Program: A pop up frame representing an email message, generated after clicking on a listctrl item (“the inbox”).

Situation: The message of one of the emails was long and part of it disappeared. Would need a vertical scrollbar to read it all! But…

Problem: As soon I changed wx.Panel to wx.ScrolledWindow or ScrolledPanel (tried both = same), the text of the message suddenly started to go all on one line…I no longer needed a vertical scrollbar, I needed + had a horizontal scrollbar to read it all.

If I change back to wx.Panel, the text wraps itself again (without being told to). It looks neat and lovely…except that I still can’t scroll down to read the rest. If I put back ScrolledWindow, suddenly all the text goes one one line. I DON’T UNDERSTAND. 🙁 Why is it doing this to me?

It’s so unpractical to read a message by scrolling horizontally back and forth, so I really really need to get the StaticText wrapped as it was before, with a vertical scrollbar to scroll through the emails that are longer. I have tried putting in a main_message.Wrap(main_message.GetSize().width) command, but it does nothing.

I want it to work so that there is a vertical scroller when needed…but no need for a horizontal scroller, i.e. no crazy text suddenly deciding it wants to be on one line. Anyone know what is doing this?

Have shrunk the code as best as can manage:

class Message(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, pos = (500, 100), size=(500, 500), style = wx.STAY_ON_TOP | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION)


        self.basicpanel = wx.ScrolledWindow(self, -1)
        self.basicpanel.SetScrollbars(1, 1, 1, 1)
        self.basicpanel.SetBackgroundColour("medium goldenrod")

        parent = self.GetParent()
        message = parent.email

        # email details e.g. sender, date, urgency, subject
        sender_st =  wx.StaticText(self.basicpanel, -1, "Sender:")
        status_st = wx.StaticText(self.basicpanel, -1, "Status:")
        date_st = wx.StaticText(self.basicpanel, -1, "Date:")
        priority_st = wx.StaticText(self.basicpanel, -1, "Priority:")
        subject_st = wx.StaticText(self.basicpanel, -1, "Subject:")

        answer_sender = wx.StaticText(self.basicpanel, -1, message.sender)
        answer_status = wx.StaticText(self.basicpanel, -1, message.status)
        answer_date = wx.StaticText(self.basicpanel, -1, message.date)
        answer_priority = wx.StaticText(self.basicpanel, -1, message.priority)
        answer_subject = wx.StaticText(self.basicpanel, -1, message.subject)

        # main body of email
        main_message = wx.StaticText(self.basicpanel, -1, message.txt)

        # create a box sizer to put in the email details like sender, date, et
        self.messagebox = wx.StaticBox(self.basicpanel, -1, '', (5,5))
        self.fgs_message = wx.FlexGridSizer(3, 4, 5, 15)
        self.fgs_message.AddMany([(sender_st, 1, wx.EXPAND), (answer_sender, 1, wx.EXPAND), (status_st, 1, wx.EXPAND), (answer_status, 1, wx.EXPAND), (date_st, 1, wx.EXPAND), (answer_date, 1, wx.EXPAND), (priority_st, 1, wx.EXPAND), (answer_priority, 1, wx.EXPAND), (subject_st, 1, wx.EXPAND), (answer_subject, 1, wx.EXPAND)])
        self.boxmessagesizer = wx.StaticBoxSizer(self.messagebox, wx.VERTICAL)
        self.boxmessagesizer.Add(self.fgs_message, 1, wx.ALL, 5)

        # create a sizer to include the above details and the main message or body of email
        self.messagebasicsizer = wx.BoxSizer(wx.VERTICAL)
        self.messagebasicsizer.Add(self.boxmessagesizer, 0, wx.EXPAND | wx.ALL, 10)
        self.messagebasicsizer.Add(main_message, 1, wx.EXPAND | wx.ALL, 10)

        # create buttons at the bottom and a horizontal sizer to put them on same line
        self.buttonreply = wx.Button(self.basicpanel, 1, 'Reply', (20,10))
        self.buttondelete = wx.Button(self.basicpanel, 1, 'Close + Delete', (40, 10))
        self.buttonsave = wx.Button(self.basicpanel, 1, 'Close + Save', (40,10))
        self.horisizer = wx.BoxSizer(wx.HORIZONTAL)
        self.horisizer.AddMany([(self.buttonreply, 0, wx.EXPAND | wx.ALL, 10), (self.buttondelete, 0, wx.EXPAND | wx.ALL, 10), (self.buttonsave, 0, wx.EXPAND | wx.ALL, 10)])

        # add buttons to sizer with message details and message
        self.messagebasicsizer.Add(self.horisizer, 0, wx.EXPAND | wx.ALIGN_CENTRE | wx.ALL, 10)


        self.basicpanel.SetSizer(self.messagebasicsizer)
        self.Bind(wx.EVT_BUTTON, self.OnDestroy)

        self.Show(True)
  • 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-30T16:35:44+00:00Added an answer on May 30, 2026 at 4:35 pm

    You should use the wordwrap module: http://www.wxpython.org/docs/api/wx.lib.wordwrap-module.html. I have an example here: http://www.blog.pythonlibrary.org/2008/06/11/wxpython-creating-an-about-box/

    Or put the text into a read-only multiline TextCtrl instead. Then you’ll have scrolling automagically. The latter is probably easier and will look better aesthetically.

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

Sidebar

Related Questions

Please help me with the missing LIBs for this MOZILLA program. Trying to create
Please help with this error .... In the following code the get info function
Please help! Background info I have a WPF application which accesses a SQL Server
current i'm doing this FQL to get user info Please help me combing all
Could someone please help me figure out what is wrong with my program, AND
Please help me to solve this: I have two strings for email-id and password
Please help to the newbie in WPF! I need to build a TreeView with
Please help me with using the DrScheme built-in function filter. create a function hello
Please help! I need to produce a Crystal Report with multiple data columns, but
Please help me to fix the CSS error in profile on my site (IE).

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.