From: Robin Dunn Date: Tue, 27 Aug 2002 01:11:04 +0000 (+0000) Subject: Some distrib updates for wxPythonOSX, and reSWIGged a bit X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9c6b48246412bfd89a0860e86c8d96275627d055 Some distrib updates for wxPythonOSX, and reSWIGged a bit git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/distrib/mac/_build b/wxPython/distrib/mac/_build index d0c81c5e96..5cc484c25b 100755 --- a/wxPython/distrib/mac/_build +++ b/wxPython/distrib/mac/_build @@ -127,7 +127,7 @@ fi #----------------------------------- msg configuring wxWindows buildDir="$srcPath/build-pkg" -dFlag= +dFlag="--enable-optimise --enable-debug_flag" if [ $debug ]; then buildDir="$srcPath/build-pkg-debug" dFlag="--enable-debug" @@ -141,7 +141,7 @@ if [ $force ]; then fi msgdo mkdir -m 775 "$buildDir" msgdo cd "$buildDir" - msgdo ../configure --with-mac --with-opengl $dFlag + msgdo ../configure --with-mac --with-opengl --enable-precomp=no $dFlag cd $curDir else @@ -153,12 +153,14 @@ fi msg building wxWindows msgdo cd $buildDir msgdo make +msgdo cd ../locale +msgdo make allmo cd $curDir #----------------------------------- msg installing wxWindows -msgdo mkdir -p -m 755 "$dstPath/$temp/$wxWindowsInst" +msgdo mkdir -p -m 1755 "$dstPath/$temp/$wxWindowsInst" msgdo cd "$buildDir" # install once to the package directory, and once to the @@ -207,13 +209,20 @@ msg copying additional wxPython files msgdo cp -pR "$srcPath/wxPython/samples" "$dstPath/$temp/$dmgRoot" msgdo cp -pR "$srcPath/wxPython/demo" "$dstPath/$temp/$dmgRoot" msgdo cp -pR "$srcPath/wxPython/licence" "$dstPath/$temp/$dmgRoot" -msgdo cp -pR "$srcPath/wxPython/tools" "$dstPath/$temp/$dmgRoot" find "$dstPath/$temp/$dmgRoot" -name "CVS" -type d -print0 | xargs -0 rm -rf find "$dstPath/$temp/$dmgRoot" -name ".DS_Store" -type f -print0 | xargs -0 rm find "$dstPath/$temp/$dmgRoot" -name ".cvsignore" -type f -print0 | xargs -0 rm find "$dstPath/$temp/$dmgRoot" -name ".#*" -type f -print0 | xargs -0 rm find "$dstPath/$temp/$dmgRoot" -name "b" -type f -print0 | xargs -0 rm find "$dstPath/$temp/$dmgRoot" -name "*~*~" -type f -print0 | xargs -0 rm + +msgdo cd "$srcPath/wxPython/scripts" +sFiles=`$pythonExec CreateMacScripts.py` +for f in $sFiles; do + msgdo cp $f "$dstPath/$temp/$wxWindowsInst/bin" +done +cd $curDir + msgdo chown -R ${user}:staff "$dstPath/$temp/$dmgRoot" diff --git a/wxPython/distrib/mac/makedmg b/wxPython/distrib/mac/makedmg index e464506415..c89be8072a 100755 --- a/wxPython/distrib/mac/makedmg +++ b/wxPython/distrib/mac/makedmg @@ -1,9 +1,9 @@ #!/usr/bin/perl -w -# +# # make disk image from folder -# +# # usage: makedmg src dst name -# +# # (C)opyright 2002 Frank Vercruesse @@ -25,12 +25,12 @@ sub make_dmg my $src = $_[0]; my $dst = $_[1]; my $name = $_[2]; - + # check dirs if( not -d $dst && -d $src ) { die "src and dst must be directories\n"; } - + # calc disk image size if( not open( MYPIPE, "$duExec -sk \"${src}\" |") ) { die "couldn't open pipe\n"; @@ -38,15 +38,15 @@ sub make_dmg (my $dmgsize) = split( /\s+/, ); close( MYPIPE); $dmgsize /= 1024; - $dmgsize = int($dmgsize + 2); + $dmgsize = int($dmgsize + 4); if( $dmgsize < 5 ) { $dmgsize = 5 } - + # create disk image system "cd \"$dst\"; $hdiUtilExec create -megabytes $dmgsize -ov \"_${name}\""; if( $? ) { die "couldn't create disk image\n"; } - + # format disk image if( not open( MYPIPE, "cd \"$dst\"; $hdiDrvExec -nomount \"_${name}.dmg\" |") ) { die "couldn't open pipe\n"; @@ -68,7 +68,7 @@ sub make_dmg if( $? ) { system "$hdiUtilExec eject $dev"; die "couldn't format disk image\n"; } system "$hdiUtilExec eject $dev"; if( $? ) { die "couldn't eject disk image\n"; } - + # copy files if( not open( MYPIPE, "cd \"$dst\"; $hdiDrvExec \"_${name}.dmg\" |") ) { die "couldn't open pipe\n"; @@ -88,7 +88,7 @@ sub make_dmg if( $? ) { system "$hdiUtilExec eject $dev"; die "couldn't copy files\n"; } system "$hdiUtilExec eject $dev"; if( $? ) { die "couldn't eject disk image\n"; } - + # convert disk image system "cd \"$dst\"; $hdiUtilExec convert \"_${name}.dmg\" -format UDCO -o \"${name}\""; if( $? ) { die "couldn't convert disk image\n"; } diff --git a/wxPython/distrib/mac/wxMacPython.info b/wxPython/distrib/mac/wxMacPython.info deleted file mode 100644 index 0b7183cdc9..0000000000 --- a/wxPython/distrib/mac/wxMacPython.info +++ /dev/null @@ -1,15 +0,0 @@ -Title wxMacPython -Version 2.3.3 -Description wxMac and wxPython -DefaultLocation / -DeleteWarning - -### Package Flags - -NeedsAuthorization YES -Required NO -Relocatable NO -RequiresReboot NO -UseUserMask NO -OverwritePermissions NO -InstallFat NO diff --git a/wxPython/distrib/mac/wxPythonOSX.info b/wxPython/distrib/mac/wxPythonOSX.info new file mode 100644 index 0000000000..662b153096 --- /dev/null +++ b/wxPython/distrib/mac/wxPythonOSX.info @@ -0,0 +1,15 @@ +Title wxPythonOSX +Version 2.3.3 +Description wxMac and wxPython for OSX +DefaultLocation / +DeleteWarning + +### Package Flags + +NeedsAuthorization YES +Required NO +Relocatable NO +RequiresReboot NO +UseUserMask NO +OverwritePermissions NO +InstallFat NO diff --git a/wxPython/scripts/CreateMacScripts.py b/wxPython/scripts/CreateMacScripts.py new file mode 100644 index 0000000000..8108771e7c --- /dev/null +++ b/wxPython/scripts/CreateMacScripts.py @@ -0,0 +1,56 @@ +#---------------------------------------------------------------------- +# Name: CreateMacScripts.py +# Purpose: Massages the scripts to be usable with MachoPython +# +# Author: Robin Dunn +# +# Created: 12-Aug-2002 +# Copyright: (c) 2002 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- + +import sys, os + +python = sys.executable +destdir = os.path.split(python)[0] +pythonw = os.path.join(destdir, 'pythonw') +scriptdir = os.getcwd() + +if len(sys.argv) > 1: + destdir = sys.argv[1] + +from CreateBatchFiles import scripts +repltxt = "#!/usr/bin/env python" + +gui_template = """\ +#!/bin/sh +exec /Applications/Python.app/Contents/MacOS/python %s.py +""" + +def main(): + for script, usegui in scripts: + destfile = os.path.join(destdir, script) + thescript = open(script).read() + if usegui: + f = open(destfile+'.py', 'w') + print destfile+'.py' + f.write(thescript.replace(repltxt, '')) + f.close() + f = open(destfile, 'w') + print destfile + f.write(gui_template % destfile) + f.close() + + else: + thescript = thescript.replace(repltxt, '#!'+python) + f = open(destfile, 'w') + print destfile + f.write(thescript) + f.close() + + os.chmod(destfile, 0755) + + +if __name__ == '__main__': + main() + diff --git a/wxPython/scripts/CreateMacSripts.py b/wxPython/scripts/CreateMacSripts.py deleted file mode 100644 index c01f2ce023..0000000000 --- a/wxPython/scripts/CreateMacSripts.py +++ /dev/null @@ -1,51 +0,0 @@ -#---------------------------------------------------------------------- -# Name: CreateMacScriptspy -# Purpose: Massages the scripts to be usable with MachoPython -# -# Author: Robin Dunn -# -# Created: 12-Aug-2002 -# Copyright: (c) 2002 by Total Control Software -# Licence: wxWindows license -#---------------------------------------------------------------------- - -import sys, os - -python = sys.executable -destdir = os.path.split(python)[0] -pythonw = os.path.join(destdir, 'pythonw') -scriptdir = os.getcwd() - -from CreateBatchFiles import scripts -repltxt = "#!/usr/bin/env python" - -gui_template = """\ -#!/bin/sh -exec /Applications/Python.app/Contents/MacOS/python %s.py -""" - -def main(): - for script, usegui in scripts: - destfile = os.path.join(destdir, script) - print "Creating", destfile - thescript = open(script).read() - if usegui: - f = open(destfile+'.py', 'w') - f.write(thescript.replace(repltxt, '')) - f.close() - f = open(destfile, 'w') - f.write(gui_template % destfile) - f.close() - - else: - thescript = thescript.replace(repltxt, '#!'+python) - f = open(destfile, 'w') - f.write(thescript) - f.close() - - os.chmod(destfile, 0755) - - -if __name__ == '__main__': - main() - diff --git a/wxPython/src/mac/frames.cpp b/wxPython/src/mac/frames.cpp index fa5dfb8857..a6ad7ee4c0 100644 --- a/wxPython/src/mac/frames.cpp +++ b/wxPython/src/mac/frames.cpp @@ -1529,6 +1529,34 @@ static PyObject *_wrap_wxFrame_SetToolBar(PyObject *self, PyObject *args, PyObje return _resultobj; } +#define wxFrame_SendSizeEvent(_swigobj) (_swigobj->SendSizeEvent()) +static PyObject *_wrap_wxFrame_SendSizeEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxFrame * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxFrame_SendSizeEvent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxFrame_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFrame_SendSizeEvent. Expected _wxFrame_p."); + return NULL; + } + } +{ + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxFrame_SendSizeEvent(_arg0); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxDialogTowxTopLevelWindow(void *ptr) { wxDialog *src; wxTopLevelWindow *dest; @@ -2620,6 +2648,7 @@ static PyMethodDef framescMethods[] = { { "wxDialog_Create", (PyCFunction) _wrap_wxDialog_Create, METH_VARARGS | METH_KEYWORDS }, { "new_wxPreDialog", (PyCFunction) _wrap_new_wxPreDialog, METH_VARARGS | METH_KEYWORDS }, { "new_wxDialog", (PyCFunction) _wrap_new_wxDialog, METH_VARARGS | METH_KEYWORDS }, + { "wxFrame_SendSizeEvent", (PyCFunction) _wrap_wxFrame_SendSizeEvent, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_SetToolBar", (PyCFunction) _wrap_wxFrame_SetToolBar, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_GetToolBar", (PyCFunction) _wrap_wxFrame_GetToolBar, METH_VARARGS | METH_KEYWORDS }, { "wxFrame_CreateToolBar", (PyCFunction) _wrap_wxFrame_CreateToolBar, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/mac/frames.py b/wxPython/src/mac/frames.py index 81d3be22cb..26b4e08cff 100644 --- a/wxPython/src/mac/frames.py +++ b/wxPython/src/mac/frames.py @@ -140,6 +140,9 @@ class wxFramePtr(wxTopLevelWindowPtr): def SetToolBar(self, *_args, **_kwargs): val = apply(framesc.wxFrame_SetToolBar,(self,) + _args, _kwargs) return val + def SendSizeEvent(self, *_args, **_kwargs): + val = apply(framesc.wxFrame_SendSizeEvent,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxFrame(wxFramePtr):