WxPython Making Window Scrollable after window goes less than a particular size

24 views
Skip to first unread message

TANMAY AGRAWAL

unread,
Sep 7, 2022, 11:17:43 AM9/7/22
to wxPython-users
Hi,
I want to make my window Scrollable when I open it in my laptop screen, as opposed to when open in my bigger monitor. I believe this thing is done by using ScrolledWindow or ScrolledPanel by some way, but I exactly don't know how. Below is the minimal code for the same :-

screenSize = wx.DisplaySize()
screenWidth = screenSize[0]
screenHeight = screenSize[1]
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.nb = wx.Notebook(self, wx.ID_ANY)
sizer_1.Add(self.nb, 1, wx.EXPAND, 0)
self.notebook_1_pane_1 = wx.lib.scrolledpanel.ScrolledPanel(self.nb,-1, size=(screenWidth,400), pos=(0,28), style=wx.SIMPLE_BORDER) self.notebook_1_pane_1.SetupScrolling()

Even on the bigger monitor screen where defining self.notebook_1_pane_1 as a simple panel (using wx.Panel) gives proper GUI (without any scrolls), making it a scrolledpanel is adding scrollbars even there and making all sizers take additional spaces.

Please help!


The information contained in this electronic communication is intended solely for the individual(s) or entity to which it is addressed. It may contain proprietary, confidential and/or legally privileged information. Any review, retransmission, dissemination, printing, copying or other use of, or taking any action in reliance on the contents of this information by person(s) or entities other than the intended recipient is strictly prohibited and may be unlawful. If you have received this communication in error, please notify us by responding to this email or telephone and immediately and permanently delete all copies of this message and any attachments from your system(s). The contents of this message do not necessarily represent the views or policies of BITS Pilani.
Reply all
Reply to author
Forward
0 new messages