sizer

How do I expand a wx.sizer of a wx.panel when the panel is expanded inside another wx.sizer?

I have a wx.Panel that has a GridBagSizer associated with it. This panel is placed inside another Sizer (BoxSizer), whose add has the expand flag - meaning that the panel takes up the full width of the sizer, which is great. ...But the panel's internal sizer does not fill the panel now. I've tried setting the internal sizer's flag to w...

WxPython: FoldPanelBar not really folding.

I've written the following code using FoldPanelBar: import wx import wx.lib.agw.foldpanelbar as fpb class frame(wx.Frame): def __init__(self,*args,**kwargs): wx.Frame.__init__(self,*args,**kwargs) self.text_ctrl_1=wx.TextCtrl(self,-1,style=wx.TE_MULTILINE) self.fpb=fpb.FoldPanelBar(self,-1, style=fpb.FPB_HO...

wxPython sizer wxGridSizer's parent class method is strangely inaccessible

Hello, I am having an issue with wxPython toolkit. I am using a wx.GridSizer object to place a grid displaying some status info. I need to update this grid, and so I came up with a few different ways of doing it. The one I prefer is to simply refresh/update the text that needs the updating, so I could try detaching the wxStaticText o...

wxwidgets custom control size cannot be set.What am i missing out

I have a Custom control derived from wxControl,inside a dialog with a vertical sizer wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); Knob* newKnob = new Knob(panel,wxID_ANY,wxDefaultPosition,wxSize(40,40)); topSizer->Add(newKnob,0,wxALL|wxALIGN_CENTER); panel->SetSizer(topSizer); topSizer->Fit(panel); //panel is a wxPanel inside t...

wxwidgets resize sizers after hiding/showing child controls

Hello, I have an wxWindow. Inside there I've got a wxBoxSize (Vertical). The sizer has 3 child controls. I want to be able to hide one of the three child controls, and have the sizer and its parent automaticly resize. For example when I hide one child control of the sizer, the window decreases by 200 pixels. Right now my method of sho...

wxPython GridSizer not attached to panel?

I'm trying to build a level editor for a game I'm working on. It pulls data from a flat file and then based on a byte-by-byte search it'll assemble a grid from pre-set tiles. This part of the app I should have no issues with. The problem is that my test version of the editor which just loads a 16x16 grid of test tiles from 00 to FF is lo...

If Possible, How Can One Set Either a Background Color on Cells within a Sizer or Gridlines for the Sizer?

I am flailing about with wxWidgets, in particular, the wx.Sizer in wxPython. I have read the documents, I have a copy of wXPython in Action before me, and have set aside the problem to work on other things a better mental model of sizers hopefully gestated within my skull. None of this has worked. I am not grokking, or even getting ...

Appropriate wx.Sizer(s) for the job?

I have a space in which I would like certain elements (represented here by A, B, D, and G) to each be in its own "corner" of the design. The corners ought to line up as if each of the four elements was repelling the other; a rectangle. This is to be contained within an unresizable panel. I will have several similar panels and want to k...

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

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 .Sho...

Getting a WxPython panel item to expand

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 StaticTex...

How to make a dynamic number of horizontal BoxSizers?

I have a fucntion that calculates the number of images that can be displayed on the screen, if there are more images than the ones that can be put on screen, I resize the images till they all can happear. Then, I want to display them with one vertical box sizer and several horizontal box sizers! The horizontal number of box sizers are...

How do I get the size of an individual cell of a wx.GridSizer?

I'm wondering if I could get the size of an individual cell of a wx.GridSizer after calling Fit(). If so, how do I do that? ...

wxPython: "Super" wx.SpinCtrl with float values, layout inside sizer

wx.SpinCtrl is limited to spinning across integers, and not floats. Therefore, I am building a wx.TextCtrl + wx.SpinButton combo class which enables me to spin across floats. I am able to size and layout both of them programmatically so that the combo looks exactly the same as an ordinary wx.SpinCtrl. I am subclassing this combo from th...

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

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 throu...

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

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 w...

use wxPython to draw a grided rectangular container or box

Hi, all, I want to draw a rectangular or a container with 20 slots inside. it is like a cd container or archive, with empty slot to insert the cd or book. I choose wxPython. for this 20 horizontal empty slots, i see there is wx.BoxSizer(wx.Horizonal) or other sizers to make the layout. my question is, Is it possible to have "visible bo...

How can I get a wxFrame to refresh without having to manually resize it in wxPython?

I have a simple frame in a wxPython script that isn't refreshing like I'd like it to. Basically the frame starts out blank. The user can then select different datasets to view in a grid form. When the dataset has been chosen, the script creates a grid and puts it in a sizer in the frame. The problem is that the frame shows the grid in a...