void SetProportion( int proportion );
int GetProportion();
+ %pythoncode { SetOption = SetProportion}
+ %pythoncode { GetOption = GetProportion}
void SetFlag( int flag );
int GetFlag();
PyObject* userData=NULL) {
wxPyUserData* data = NULL;
- wxPyBeginBlockThreads();
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False);
if ( userData && (info.window || info.sizer || info.gotSize) )
data = new wxPyUserData(userData);
- wxPyEndBlockThreads();
+ wxPyEndBlockThreads(blocked);
// Now call the real Add method if a valid item type was found
if ( info.window )
int border=0, PyObject* userData=NULL) {
wxPyUserData* data = NULL;
- wxPyBeginBlockThreads();
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False);
if ( userData && (info.window || info.sizer || info.gotSize) )
data = new wxPyUserData(userData);
- wxPyEndBlockThreads();
+ wxPyEndBlockThreads(blocked);
// Now call the real Insert method if a valid item type was found
if ( info.window )
PyObject* userData=NULL) {
wxPyUserData* data = NULL;
- wxPyBeginBlockThreads();
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, True, False);
if ( userData && (info.window || info.sizer || info.gotSize) )
data = new wxPyUserData(userData);
- wxPyEndBlockThreads();
+ wxPyEndBlockThreads(blocked);
// Now call the real Prepend method if a valid item type was found
if ( info.window )
bool Remove(PyObject* item) {
- wxPyBeginBlockThreads();
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
- wxPyEndBlockThreads();
+ wxPyEndBlockThreads(blocked);
if ( info.window )
return self->Remove(info.window);
else if ( info.sizer )
void _SetItemMinSize(PyObject* item, const wxSize& size) {
- wxPyBeginBlockThreads();
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
- wxPyEndBlockThreads();
+ wxPyEndBlockThreads(blocked);
if ( info.window )
self->SetItemMinSize(info.window, size);
else if ( info.sizer )
%pythoncode {
def AddMany(self, widgets):
+ """
+ AddMany is a convenience method for adding several items
+ to a sizer at one time. Simply pass it a list of tuples,
+ where each tuple consists of the parameters that you
+ would normally pass to the `Add` method.
+ """
for childinfo in widgets:
if type(childinfo) != type(()) or (len(childinfo) == 2 and type(childinfo[0]) == type(1)):
childinfo = (childinfo, )
self.Add(*childinfo)
- # for backwards compatibility only, do not use in new code
- AddWindow = AddSizer = AddSpacer = Add
- PrependWindow = PrependSizer = PrependSpacer = Prepend
- InsertWindow = InsertSizer = InsertSpacer = Insert
- RemoveWindow = RemoveSizer = RemovePos = Remove
+ %# for backwards compatibility only, please do not use in new code
+ AddWindow = wx._deprecated(Add, "AddWindow is deprecated, use `Add` instead.")
+ AddSizer = wx._deprecated(Add, "AddSizer is deprecated, use `Add` instead.")
+ AddSpacer = wx._deprecated(Add, "AddSpacer is deprecated, use `Add` instead.")
+ PrependWindow = wx._deprecated(Prepend, "PrependWindow is deprecated, use `Prepend` instead.")
+ PrependSizer = wx._deprecated(Prepend, "PrependSizer is deprecated, use `Prepend` instead.")
+ PrependSpacer = wx._deprecated(Prepend, "PrependSpacer is deprecated, use `Prepend` instead.")
+ InsertWindow = wx._deprecated(Insert, "InsertWindow is deprecated, use `Insert` instead.")
+ InsertSizer = wx._deprecated(Insert, "InsertSizer is deprecated, use `Insert` instead.")
+ InsertSpacer = wx._deprecated(Insert, "InsertSpacer is deprecated, use `Insert` instead.")
+ RemoveWindow = wx._deprecated(Remove, "RemoveWindow is deprecated, use `Remove` instead.")
+ RemoveSizer = wx._deprecated(Remove, "RemoveSizer is deprecated, use `Remove` instead.")
+ RemovePos = wx._deprecated(Remove, "RemovePos is deprecated, use `Remove` instead.")
def SetItemMinSize(self, item, *args):
void SetDimension( int x, int y, int width, int height );
- void SetMinSize(wxSize size);
+ void SetMinSize( const wxSize &size );
wxSize GetSize();
wxPoint GetPosition();
%extend {
void Show(PyObject* item, bool show = True) {
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
+ wxPyEndBlockThreads(blocked);
if ( info.window )
self->Show(info.window, show);
else if ( info.sizer )
void Hide(PyObject* item) {
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
+ wxPyEndBlockThreads(blocked);
if ( info.window )
self->Hide(info.window);
else if ( info.sizer )
bool IsShown(PyObject* item) {
+ bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, False);
+ wxPyEndBlockThreads(blocked);
if ( info.window )
return self->IsShown(info.window);
else if ( info.sizer )
class wxPySizer : public wxSizer {
public:
- %addtofunc wxPySizer "self._setCallbackInfo(self, PySizer);self._setOORInfo(self)"
+ %pythonAppend wxPySizer "self._setCallbackInfo(self, PySizer);self._setOORInfo(self)"
wxPySizer();
void _setCallbackInfo(PyObject* self, PyObject* _class);
class wxBoxSizer : public wxSizer {
public:
- %addtofunc wxBoxSizer "self._setOORInfo(self)"
+ %pythonAppend wxBoxSizer "self._setOORInfo(self)"
wxBoxSizer(int orient = wxHORIZONTAL);
class wxStaticBoxSizer : public wxBoxSizer {
public:
- %addtofunc wxStaticBoxSizer "self._setOORInfo(self)"
+ %pythonAppend wxStaticBoxSizer "self._setOORInfo(self)"
wxStaticBoxSizer(wxStaticBox *box, int orient = wxHORIZONTAL);
class wxGridSizer: public wxSizer
{
public:
- %addtofunc wxGridSizer "self._setOORInfo(self)"
+ %pythonAppend wxGridSizer "self._setOORInfo(self)"
wxGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );
class wxFlexGridSizer: public wxGridSizer
{
public:
- %addtofunc wxFlexGridSizer "self._setOORInfo(self)"
+ %pythonAppend wxFlexGridSizer "self._setOORInfo(self)"
wxFlexGridSizer( int rows=1, int cols=0, int vgap=0, int hgap=0 );