[Python] rispondete presto() prendere elementi del menu passati con ciclo for?

2006-11-30 Per discussione mar joe
CIAO RAGAZZI HO DEFINITO UN MENU E GLI HO PASSATO I NOMI DA UNA LISTA CON UN 
CICLO FOR


#---
# CREO IL FRAME
#---

   frame_menu=Frame(self)
   frame_menu.pack(side=TOP,fill=X)

#-
# CREO IL PULSANTE NEL FRAME
#-

   pulsante_parametri=Menubutton(frame_menu,text='Parametri')
   pulsante_parametri.pack(side=LEFT)


#
# CREO IL MENU NEL PULSANTE
#---

  parametri=Menu(pulsante_parametri)
   for i in range(len(dict.keys())):
   parametro=dict.keys()[i]


#--
# CASTUMIZZO IL MENU
#--


parametri.add_cascade(label=parametro,command=self.visualizza(quadro_informazioni))
   pulsante_parametri.config(menu=parametri)

#-
# CREO UN SECONDO FRAME
#-



quadro_informazioni=Frame(self,bg=white,relief=RIDGE,borderwidth=5)
   quadro_informazioni.pack(side=TOP,expand=YES,fill=BOTH)

#
# CREO IL METODO VISUALIZZA CHE VIENE CHIAMATO DA UN ELEMENTO DEL MENU 
QUANDO PREMUTO CON COMMAND

#

   def visualizza(self,quadro_informazioni):


  L=Label(quadro_contenitore_informazioni,text=ciao)
  L.pack()





QUESTO CODICE MI CREA SOLO IL PULSANTE ALL'INTERNO DEL FRAME E SI BLOCCA

MENTRE SE CREO IL SECONDO FRAME PRIMA DELLA CREAZIONE DEL MENU' FUNZIONA, 
CIOE' OLTRE AL PULSANTE NEL FRAME MI FA VISUALIZZARE IL MENU NEL PULSANTE, 
MA SUCCEDE CHE MI DA TANTE LABEL 'CIAO' E SE CLISSO SU UN ELEMENTO DEL MENU' 
NON FA NULLA



ALLORA IO PENSO CHE HO SBAGLIATO A CREARE I MENU CON IL CICLO FOR, ED E' PER 
QUESTO CHE IL METODO VISUALIZZA VIENE GENERATO TANTE VOLTE TANTE QUANTE 
SONOGLI ELEMENTI DEL MENU


ALLORA RAGAZZI QUESTA E' LA DOMANDA SE AVETE CAPITO BENE IL CODICE:

HO SBAGLIATO A CREARE I MENU' CON IL CICLO FOR?, SECONDO ME DOVEVO CREARE UN 
OGGETTO CON NOME PER OGNI MENU'.


QUESTO PERCHE', PERCHE' SE IO ADESSO VOGLIO ANDARE A PRENDERE GLI ELEMENTI 
DEL MENU' NON SO IN CHE OGGETTO SONO, VOI SAPETE COME SI FA, A PRENDERE GLI 
ELEMENTI DEL MENU'?, COSI'IN TAL MODO POSSO APPLICARE IL COMANDO 
SEPARATAMENTE ALLA CREAZIONE.


_
Aggiungi i tuoi nuovi contatti di Hotmail anche in Messenger.Con un click! 
http://join.msn.com/hotmail/features-std#6


___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] rispondete presto() prendere elementi del menu passati con ciclo for?

2006-11-30 Per discussione Carlo C8E Miron

presto() prendere elementi del menu passati con ciclo for?

--
Carlo C8E Miron, ICQ #26429731
--
Disclaimer:
If I receive a message from you, you are agreeing that:
1. I am by definition, the intended recipient.
2. All information in the email is mine to do with as I see fit and
make such financial profit, political mileage, or good joke as it
lends itself to. In particular, I may quote it on USENET or the WWW.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that
may be included on your message.
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python