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
1fa649f2
Commit
1fa649f2
authored
Aug 03, 2004
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #986929: Add support for wish -sync and -use options.
parent
9441c078
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
4 deletions
+39
-4
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_tkinter.c
Modules/_tkinter.c
+37
-4
No files found.
Misc/NEWS
View file @
1fa649f2
...
...
@@ -72,6 +72,8 @@ Extension modules
Library
-------
-
Tkinter
now
supports
the
wish
-
sync
and
-
use
options
.
-
The
following
methods
in
time
support
passing
of
None
:
ctime
(),
gmtime
(),
and
localtime
().
If
None
is
provided
,
the
current
time
is
used
(
the
same
as
when
the
argument
is
omitted
).
...
...
Modules/_tkinter.c
View file @
1fa649f2
...
...
@@ -576,7 +576,7 @@ static void DisableEventHook(void); /* Forward */
static
TkappObject
*
Tkapp_New
(
char
*
screenName
,
char
*
baseName
,
char
*
className
,
int
interactive
,
int
wantobjects
,
int
wantTk
)
int
interactive
,
int
wantobjects
,
int
wantTk
,
int
sync
,
char
*
use
)
{
TkappObject
*
v
;
char
*
argv0
;
...
...
@@ -644,6 +644,35 @@ Tkapp_New(char *screenName, char *baseName, char *className,
Tcl_SetVar
(
v
->
interp
,
"_tkinter_skip_tk_init"
,
"1"
,
TCL_GLOBAL_ONLY
);
}
/* some initial arguments need to be in argv */
if
(
sync
||
use
)
{
int
len
=
0
;
if
(
sync
)
len
+=
sizeof
"-sync"
;
if
(
use
)
len
+=
strlen
(
use
)
+
sizeof
"-use "
;
char
*
args
=
(
char
*
)
ckalloc
(
len
);
if
(
!
args
)
{
PyErr_NoMemory
();
Py_DECREF
(
v
);
return
NULL
;
}
args
[
0
]
=
'\0'
;
if
(
sync
)
strcat
(
args
,
"-sync"
);
if
(
use
)
{
if
(
sync
)
strcat
(
args
,
" "
);
strcat
(
args
,
"-use "
);
strcat
(
args
,
use
);
}
Tcl_SetVar
(
v
->
interp
,
"argv"
,
args
,
TCL_GLOBAL_ONLY
);
ckfree
(
args
);
}
if
(
Tcl_AppInit
(
v
->
interp
)
!=
TCL_OK
)
return
(
TkappObject
*
)
Tkinter_Error
((
PyObject
*
)
v
);
...
...
@@ -2835,6 +2864,8 @@ Tkinter_Create(PyObject *self, PyObject *args)
int
interactive
=
0
;
int
wantobjects
=
0
;
int
wantTk
=
1
;
/* If false, then Tk_Init() doesn't get called */
int
sync
=
0
;
/* pass -sync to wish */
char
*
use
=
NULL
;
/* pass -use to wish */
baseName
=
strrchr
(
Py_GetProgramName
(),
'/'
);
if
(
baseName
!=
NULL
)
...
...
@@ -2843,13 +2874,15 @@ Tkinter_Create(PyObject *self, PyObject *args)
baseName
=
Py_GetProgramName
();
className
=
"Tk"
;
if
(
!
PyArg_ParseTuple
(
args
,
"|zssiii:create"
,
if
(
!
PyArg_ParseTuple
(
args
,
"|zssiii
iz
:create"
,
&
screenName
,
&
baseName
,
&
className
,
&
interactive
,
&
wantobjects
,
&
wantTk
))
&
interactive
,
&
wantobjects
,
&
wantTk
,
&
sync
,
&
use
))
return
NULL
;
return
(
PyObject
*
)
Tkapp_New
(
screenName
,
baseName
,
className
,
interactive
,
wantobjects
,
wantTk
);
interactive
,
wantobjects
,
wantTk
,
sync
,
use
);
}
static
PyObject
*
...
...
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