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
4c704131
Kaydet (Commit)
4c704131
authored
Haz 19, 1998
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added {Get,Set}PopupData calls to get at the data for popup menu controls.
üst
cef4c844
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
0 deletions
+85
-0
Ctlmodule.c
Mac/Modules/ctl/Ctlmodule.c
+48
-0
ctlsupport.py
Mac/Modules/ctl/ctlsupport.py
+37
-0
No files found.
Mac/Modules/ctl/Ctlmodule.c
Dosyayı görüntüle @
4c704131
...
...
@@ -866,6 +866,50 @@ static PyObject *CtlObj_TrackControl(_self, _args)
}
static
PyObject
*
CtlObj_GetPopupData
(
_self
,
_args
)
ControlObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
PopupPrivateDataHandle
hdl
;
if
(
(
*
_self
->
ob_itself
)
->
contrlData
==
NULL
)
{
PyErr_SetString
(
Ctl_Error
,
"No contrlData handle in control"
);
return
0
;
}
hdl
=
(
PopupPrivateDataHandle
)(
*
_self
->
ob_itself
)
->
contrlData
;
HLock
((
Handle
)
hdl
);
_res
=
Py_BuildValue
(
"O&i"
,
MenuObj_New
,
(
*
hdl
)
->
mHandle
,
(
int
)(
*
hdl
)
->
mID
);
HUnlock
((
Handle
)
hdl
);
return
_res
;
}
static
PyObject
*
CtlObj_SetPopupData
(
_self
,
_args
)
ControlObject
*
_self
;
PyObject
*
_args
;
{
PyObject
*
_res
=
NULL
;
PopupPrivateDataHandle
hdl
;
MenuHandle
mHandle
;
short
mID
;
if
(
!
PyArg_ParseTuple
(
_args
,
"O&h"
,
MenuObj_Convert
,
&
mHandle
,
&
mID
)
)
return
0
;
if
(
(
*
_self
->
ob_itself
)
->
contrlData
==
NULL
)
{
PyErr_SetString
(
Ctl_Error
,
"No contrlData handle in control"
);
return
0
;
}
hdl
=
(
PopupPrivateDataHandle
)(
*
_self
->
ob_itself
)
->
contrlData
;
(
*
hdl
)
->
mHandle
=
mHandle
;
(
*
hdl
)
->
mID
=
mID
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
PyMethodDef
CtlObj_methods
[]
=
{
{
"HiliteControl"
,
(
PyCFunction
)
CtlObj_HiliteControl
,
1
,
"(ControlPartCode hiliteState) -> None"
},
...
...
@@ -953,6 +997,10 @@ static PyMethodDef CtlObj_methods[] = {
"() -> None"
},
{
"TrackControl"
,
(
PyCFunction
)
CtlObj_TrackControl
,
1
,
NULL
},
{
"GetPopupData"
,
(
PyCFunction
)
CtlObj_GetPopupData
,
1
,
NULL
},
{
"SetPopupData"
,
(
PyCFunction
)
CtlObj_SetPopupData
,
1
,
NULL
},
{
NULL
,
NULL
,
0
}
};
...
...
Mac/Modules/ctl/ctlsupport.py
Dosyayı görüntüle @
4c704131
...
...
@@ -204,6 +204,43 @@ f = ManualGenerator("TrackControl", trackcontrol_body);
#f.docstring = "(Point startPoint [,trackercallback]) -> (ControlPartCode _rv)"
object
.
add
(
f
)
# And manual generators to get/set popup menu information
getpopupdata_body
=
"""
PopupPrivateDataHandle hdl;
if ( (*_self->ob_itself)->contrlData == NULL ) {
PyErr_SetString(Ctl_Error, "No contrlData handle in control");
return 0;
}
hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
HLock((Handle)hdl);
_res = Py_BuildValue("O&i", MenuObj_New, (*hdl)->mHandle, (int)(*hdl)->mID);
HUnlock((Handle)hdl);
return _res;
"""
f
=
ManualGenerator
(
"GetPopupData"
,
getpopupdata_body
)
object
.
add
(
f
)
setpopupdata_body
=
"""
PopupPrivateDataHandle hdl;
MenuHandle mHandle;
short mID;
if (!PyArg_ParseTuple(_args, "O&h", MenuObj_Convert, &mHandle, &mID) )
return 0;
if ( (*_self->ob_itself)->contrlData == NULL ) {
PyErr_SetString(Ctl_Error, "No contrlData handle in control");
return 0;
}
hdl = (PopupPrivateDataHandle)(*_self->ob_itself)->contrlData;
(*hdl)->mHandle = mHandle;
(*hdl)->mID = mID;
Py_INCREF(Py_None);
return Py_None;
"""
f
=
ManualGenerator
(
"SetPopupData"
,
setpopupdata_body
)
object
.
add
(
f
)
# generate output (open the output file as late as possible)
SetOutputFileName
(
OUTPUTFILE
)
...
...
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