Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
53627592
Commit
53627592
authored
Apr 22, 2003
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting the auto dispose flag on window objects.
parent
a14dae9b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
Mac/Modules/win/_Winmodule.c
Mac/Modules/win/_Winmodule.c
+23
-3
Mac/Modules/win/winedit.py
Mac/Modules/win/winedit.py
+19
-0
No files found.
Mac/Modules/win/_Winmodule.c
View file @
53627592
...
@@ -2300,6 +2300,24 @@ static PyObject *WinObj_ShowWindow(WindowObject *_self, PyObject *_args)
...
@@ -2300,6 +2300,24 @@ static PyObject *WinObj_ShowWindow(WindowObject *_self, PyObject *_args)
return
_res
;
return
_res
;
}
}
static
PyObject
*
WinObj_AutoDispose
(
WindowObject
*
_self
,
PyObject
*
_args
)
{
PyObject
*
_res
=
NULL
;
int
onoff
,
old
=
0
;
if
(
!
PyArg_ParseTuple
(
_args
,
"i"
,
&
onoff
))
return
NULL
;
if
(
_self
->
ob_freeit
)
old
=
1
;
if
(
onoff
)
_self
->
ob_freeit
=
PyMac_AutoDisposeWindow
;
else
_self
->
ob_freeit
=
NULL
;
_res
=
Py_BuildValue
(
"i"
,
old
);
return
_res
;
}
static
PyMethodDef
WinObj_methods
[]
=
{
static
PyMethodDef
WinObj_methods
[]
=
{
{
"GetWindowOwnerCount"
,
(
PyCFunction
)
WinObj_GetWindowOwnerCount
,
1
,
{
"GetWindowOwnerCount"
,
(
PyCFunction
)
WinObj_GetWindowOwnerCount
,
1
,
PyDoc_STR
(
"() -> (UInt32 outCount)"
)},
PyDoc_STR
(
"() -> (UInt32 outCount)"
)},
...
@@ -2540,6 +2558,8 @@ static PyMethodDef WinObj_methods[] = {
...
@@ -2540,6 +2558,8 @@ static PyMethodDef WinObj_methods[] = {
PyDoc_STR
(
"(short hGlobal, short vGlobal, Boolean front) -> None"
)},
PyDoc_STR
(
"(short hGlobal, short vGlobal, Boolean front) -> None"
)},
{
"ShowWindow"
,
(
PyCFunction
)
WinObj_ShowWindow
,
1
,
{
"ShowWindow"
,
(
PyCFunction
)
WinObj_ShowWindow
,
1
,
PyDoc_STR
(
"() -> None"
)},
PyDoc_STR
(
"() -> None"
)},
{
"AutoDispose"
,
(
PyCFunction
)
WinObj_AutoDispose
,
1
,
PyDoc_STR
(
"(int)->int. Automatically DisposeHandle the object on Python object cleanup"
)},
{
NULL
,
NULL
,
0
}
{
NULL
,
NULL
,
0
}
};
};
...
...
Mac/Modules/win/winedit.py
View file @
53627592
...
@@ -48,5 +48,24 @@ f = Method(void, 'ShowWindow',
...
@@ -48,5 +48,24 @@ f = Method(void, 'ShowWindow',
)
)
methods
.
append
(
f
)
methods
.
append
(
f
)
#
# A method to set the auto-dispose flag
#
AutoDispose_body
=
"""
int onoff, old = 0;
if (!PyArg_ParseTuple(_args, "i", &onoff))
return NULL;
if ( _self->ob_freeit )
old = 1;
if ( onoff )
_self->ob_freeit = PyMac_AutoDisposeWindow;
else
_self->ob_freeit = NULL;
_res = Py_BuildValue("i", old);
return _res;
"""
f
=
ManualGenerator
(
"AutoDispose"
,
AutoDispose_body
)
f
.
docstring
=
lambda
:
"(int)->int. Automatically DisposeHandle the object on Python object cleanup"
methods
.
append
(
f
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment