sizer

wxPython: how to lay one panel over another

半腔热情 提交于 2021-01-28 03:26:44
问题 This is about wxPython. I would like to have 2 Panels laying one over the other: PanelBG should be some sort of a "background", with its own GridBagSizer with subPanels, StaticTexts and so on; PanelFG should be the "foreground" panel, also with its own GridBagSizer with some StaticTexts, Buttons... but a transparent background, in such a way that PanelBG is visible wherever PanelFG doesn't lay widgets. I need both Panels to stretch to all the sides of the frame, even when resizing the window,

Getting a WxPython panel item to expand

我们两清 提交于 2020-01-03 18:49:06
问题 I have a WxPython frame containing a single item, such as: class Panel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) self.text = wx.StaticText(self, label='Panel 1') I have a frame containing several panels, including this one, and dimensions are ruled by sizers. I would like this StaticText to expand. Using a BoxSizer containing just the text and setting the wx.EXPAND flag does the trick, but it seems silly to use a sizer just for one item. Any simpler solution? (I

ScrolledPanel with vertical scrollbar only and WrapSizer

给你一囗甜甜゛ 提交于 2019-12-30 10:22:55
问题 I uses a WrapSizer in order to have an automatic layout (as thumbnail gallery) like this (see screenshot on the left ) : I would like that if there are two many elements, a (vertical only)- ScrollBar is added on the panel (see right screenshot). How to add such a vertical scrollbar to a panel using a WrapSizer? I tried by mixing WrapSizer and ScrolledPanel , but I cannot get the desired layout. class MyPanel(scrolled.ScrolledPanel): def __init__(self, parent): scrolled.ScrolledPanel.__init__

ScrolledPanel with vertical scrollbar only and WrapSizer

拟墨画扇 提交于 2019-12-30 10:22:48
问题 I uses a WrapSizer in order to have an automatic layout (as thumbnail gallery) like this (see screenshot on the left ) : I would like that if there are two many elements, a (vertical only)- ScrollBar is added on the panel (see right screenshot). How to add such a vertical scrollbar to a panel using a WrapSizer? I tried by mixing WrapSizer and ScrolledPanel , but I cannot get the desired layout. class MyPanel(scrolled.ScrolledPanel): def __init__(self, parent): scrolled.ScrolledPanel.__init__

ScrolledPanel with vertical scrollbar only and WrapSizer

倾然丶 夕夏残阳落幕 提交于 2019-12-30 10:22:30
问题 I uses a WrapSizer in order to have an automatic layout (as thumbnail gallery) like this (see screenshot on the left ) : I would like that if there are two many elements, a (vertical only)- ScrollBar is added on the panel (see right screenshot). How to add such a vertical scrollbar to a panel using a WrapSizer? I tried by mixing WrapSizer and ScrolledPanel , but I cannot get the desired layout. class MyPanel(scrolled.ScrolledPanel): def __init__(self, parent): scrolled.ScrolledPanel.__init__

wxpython notebook inside boxsizer

假装没事ソ 提交于 2019-12-23 03:28:16
问题 What is wrong with this code? I am trying to place a notebook on a panel that is being controlled by a boxsizer. I am new to wxpython and can't figure out what I am doing wrong. When I run it it just makes a mess in the corner :( import wx class TestNoteBook(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(600, 500)) panel = wx.Panel(self) hsizer = wx.BoxSizer(wx.HORIZONTAL) leftpanel = wx.Panel(panel) notebook = wx.Notebook(leftpanel)

Why Does .Hide()ing and .Show()ing Panels in wxPython Result in the Sizer Changing the Layout?

冷暖自知 提交于 2019-12-20 09:58:34
问题 As referenced in my previous question, I am trying to make something slightly wizard-like in function. I have settled on a single frame with a sizer added to it. I build panels for each of the screens I would like users to see, add them to the frame's sizer, then switch between panels by .Hide() ing one panel, then calling a custom .ShowYourself() on the next panel. Obviously, I would like the buttons to remain in the same place as the user progresses through the process. I have linked

Fitting a big grid (wxGrid) in a dialog (wxDialog)

China☆狼群 提交于 2019-12-13 05:40:02
问题 Here is my layout: I have a sizer that contains a grid (with a proportion of 1) and a ok/cancel button bar The all thing is in a wxDialog Here it is: ||||||||||||||| | | | GRID | | | | | | | ||||||||||||||| | OK CANCEL | ||||||||||||||| The issue is that the grid contains too many row, and over flow the screen, so in the end I don't see the top part of the dialog. Is there a way, when calling Fit() on the dialog, to limit its height ? I have tried stuff like this: SetSizeHints(-1,-1,-1,500);

wxPython: wx.PyControl layout problem when it is a child of a wx.Panel

浪尽此生 提交于 2019-12-12 04:25:47
问题 This is a continuation from this question: wxPython: Can a wx.PyControl contain a wx.Sizer? The main topic here is using a wx.Sizer inside a wx.PyControl . I had problems Fit() ting my CustomWidget around its child widgets. That problem was solved by calling Layout() after Fit() . However , as far as I have experienced, the solution only works when the CustomWidget is a direct child of a wx.Frame . It breaks down when it becomes a child of a wx.Panel . EDIT: Using the code below, the

wxPython: Can a wx.PyControl contain a wx.Sizer?

旧城冷巷雨未停 提交于 2019-12-11 03:06:00
问题 Can a wx.PyControl contain a wx.Sizer ? Note that what I am ultimately trying to do here (spinner with float values) is already answered in another question. I am particularly interested in layouting widgets within a wx.PyControl , a skill which might prove useful if I come across a need to make my own custom widgets. I already read through CreatingCustomControls, but it didn't use sizers within the wx.PyControl subclass. Using my code below, my CustomWidget just doesn't look right. I'm not