[Pythonmac-SIG] Pop-down list in MacPython

Jack Jansen jack@oratrix.nl
Wed, 16 Feb 2000 17:49:32 +0100


> Hello,
> 
> I just created an app using Python and I want to include a
> drop-down list in one of the dialogs. I was able to make
> one with adding a CNTL in ResEdit with an associated menu,
> but now I have to problems:
> 
> 1. How do I get the selected item of the list when the user
>     dismisses the dialog box?
> 
> 2. How do I change the contents of this drop-down list based
>     on a list I get elsewhere? I don't have to change it when the
>     drop-down list when the dialog box is shown, but only before
>     the dialog box is shown.

Pieter,
all this is pretty hairy if you use Pre-Appearance calls: you create a popup 
menu (see FrameWork for an example) and then you stuff this menu into the 
control (Inside Mac has the details on this). I forget whether you have to 
stuff only the Menu ID, only the Menu Handle or both, but I do remember that 
this is important.

Fortunately all this has become a lot simpler with Appearance. If you run 
MacPython from the CVS archive you can have appearance support now, otherwise 
you'll have to wiat for another 1-2 months until I finally find the time to do 
a new distribution.

--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm