mercoledì 16 gennaio 2019

PreoneStack e OpenStack, come usarli

Come sapete i messaggi PreOpenStack e OpenStack si attivano all'apertura di una finestra. Ora se mettete questi messaggi nello stack della finestra principale (mainstack), si attiveranno anche quando si aprono altre finestre del vostro programma (substack)che non hanno al loro interno i messaggi PreOpenStack e OpenStack.
Per evitare ciò, vi consiglio di scrivere il codice in questo modo:


on PreOpenStack
  if the owner of the target is me then
     -- code runs for this stack only
     answer "Sono il mainstack"
  else
     -- code runs for any stack that's opened other than this one
     answer "Sono un Substack"
  end if
end PreOpenStack

Nessun commento:

Posta un commento