Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
97867b2c
Kaydet (Commit)
97867b2c
authored
Agu 08, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add optional casts to free() calls. (Jack)
Set Tk variable argv0 to classname passed in to Tkapp_New. (Fred)
üst
82df03e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
_tkinter.c
Modules/_tkinter.c
+24
-5
No files found.
Modules/_tkinter.c
Dosyayı görüntüle @
97867b2c
...
...
@@ -26,6 +26,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* _tkinter.c -- Interface to libtk.a and libtcl.a. */
#include "Python.h"
#include <ctype.h>
#include <tcl.h>
#include <tk.h>
...
...
@@ -49,9 +50,12 @@ extern struct { Tk_Window win; } *tkMainWindowList;
/*
** Additional cruft needed by Tcl/Tk on the Mac.
** This is for Tcl 7.5 and Tk 4.1 (
final releases
).
** This is for Tcl 7.5 and Tk 4.1 (
patch release 1
).
*/
/* free() expects a char* */
#define FREECAST (char *)
#include <Events.h>
/* For EventRecord */
typedef
int
(
*
TclMacConvertEventPtr
)
Py_PROTO
((
EventRecord
*
eventPtr
));
...
...
@@ -62,6 +66,10 @@ staticforward int PyMacConvertEvent Py_PROTO((EventRecord *eventPtr));
#endif
/* macintosh */
#ifndef FREECAST
#define FREECAST
#endif
/**** Tkapp Object Declaration ****/
staticforward
PyTypeObject
Tkapp_Type
;
...
...
@@ -201,9 +209,9 @@ Merge (args)
for
(
i
=
0
;
i
<
argc
;
i
++
)
if
(
fv
[
i
])
free
(
argv
[
i
]);
if
(
argv
!=
argvStore
)
free
(
argv
);
free
(
FREECAST
argv
);
if
(
fv
!=
fvStore
)
free
(
fv
);
free
(
FREECAST
fv
);
return
res
;
}
...
...
@@ -239,7 +247,7 @@ Split (self, list)
PyTuple_SetItem
(
v
,
i
,
Split
(
self
,
argv
[
i
]));
}
free
(
argv
);
free
(
FREECAST
argv
);
return
v
;
}
...
...
@@ -276,6 +284,7 @@ Tkapp_New (screenName, baseName, className, interactive)
int
interactive
;
{
TkappObject
*
v
;
char
*
argv0
;
v
=
PyObject_NEW
(
TkappObject
,
&
Tkapp_Type
);
if
(
v
==
NULL
)
...
...
@@ -300,6 +309,16 @@ Tkapp_New (screenName, baseName, className, interactive)
else
Tcl_SetVar
(
v
->
interp
,
"tcl_interactive"
,
"0"
,
TCL_GLOBAL_ONLY
);
/* This is used to get the application class for Tk 4.1 and up */
argv0
=
(
char
*
)
malloc
(
strlen
(
className
)
+
1
);
if
(
argv0
!=
NULL
)
{
strcpy
(
argv0
,
className
);
if
(
isupper
(
argv0
[
0
]))
argv0
[
0
]
=
tolower
(
argv0
[
0
]);
Tcl_SetVar
(
v
->
interp
,
"argv0"
,
argv0
,
TCL_GLOBAL_ONLY
);
free
(
argv0
);
}
if
(
Tcl_AppInit
(
v
->
interp
)
!=
TCL_OK
)
return
(
TkappObject
*
)
Tkinter_Error
(
v
);
...
...
@@ -677,7 +696,7 @@ Tkapp_SplitList (self, args)
for
(
i
=
0
;
i
<
argc
;
i
++
)
PyTuple_SetItem
(
v
,
i
,
PyString_FromString
(
argv
[
i
]));
free
(
argv
);
free
(
FREECAST
argv
);
return
v
;
}
...
...
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