sizer

wxPython: How to get sizer from wx.StaticText?

ⅰ亾dé卋堺 提交于 2019-12-11 01:49:19
问题 The widget is in one of many sizers I make, but how to get sizer of one of these widgets, for example in wx.StaticText . First, I though wx.StaticText have a method GetSizer() because it derived from wx.Window , but it always return None , is there a way? Sorry for my poor language. EDIT (08/23/2012) Solution from Mike Driscoll: Using self.sizer.GetChildren() to get SizerItemList from some sizer, then using GetWindow() to get actual widget from the list 回答1: If the sizer has children, then

wxpython notebook inside boxsizer

和自甴很熟 提交于 2019-12-06 15:56:59
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) posterpage = wx.Panel(notebook) listpage = wx.Panel(notebook) notebook.AddPage(posterpage, 'posters') notebook

wxpython layout with sizers

杀马特。学长 韩版系。学妹 提交于 2019-12-06 04:51:20
问题 I'm having difficulty getting my sizers to work properly in wxpython. I am trying to do a simple one horizontal bar at top (with text in it) and two vertical boxes below (with gridsizers * the left one should only be 2 columns!! * inside each). I want the everything in the image to stretch and fit my panel as well (with the ability to add padding to sides and top/bottom). I have two main issues: 1. I cant get the text in the horizontal bar to be in the middle (it goes to the left) 2. I would

wxpython layout with sizers

有些话、适合烂在心里 提交于 2019-12-04 12:02:48
I'm having difficulty getting my sizers to work properly in wxpython. I am trying to do a simple one horizontal bar at top (with text in it) and two vertical boxes below (with gridsizers * the left one should only be 2 columns!! * inside each). I want the everything in the image to stretch and fit my panel as well (with the ability to add padding to sides and top/bottom). I have two main issues: 1. I cant get the text in the horizontal bar to be in the middle (it goes to the left) 2. I would like to space the two vertical boxes to span AND fit the page appropriately (also would like the grids

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

て烟熏妆下的殇ゞ 提交于 2019-11-30 03:46:33
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 together two panels in an infinite loop by their "Back" and "Next" buttons so you can see what is going on.