Apple Newton Utilities Guia do Utilizador Página 716

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 942
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 715
CHAPTER 19
Built-in Applications and System Data
19-42 Icons and the Extras Drawer
Creating a Script Icon 19
Installation of a script icon is basically the same as that for a soup icon. The two
main differences are that the symbol
'scriptEntry is passed in for the iconType
parameter of
AddExtraIcon, and the paramFrame argument contains different
slots. However, with a script icon it is not important to keep this icon in the internal
store. Instead, you should ensure that the icon is installed on the same store as the
package with which it is associated.
The most likely use for a script icon is for a transport to bring up an interface for
user preferences. The code sample shown below brings up a such a slip:
//Useful constants.
DefConst('kMyConfigSlipSym,
Intern("configSlip:" & kAppSymbol));
constant kScriptIconName := "ScriptIcon Slip";
constant kScriptIconPkgName:= Intern ("Script:" &
kAppSymbol);
// get the icon picture
r := OpenResFileX(HOME & "pictures");
DefConst('kMyScriptIcon, GetPictAsBits("TARDIS", nil));
CloseResFileX(r);
// the tap action, small and simple
DefConst('kTapScript, func()
GetGlobalVar(kMyConfigSlipSym):Open() );
DefConst('kScriptIconParamFrame,
{
// name in the Extras Drawer
text: kScriptIconName,
// icon in the Extras Drawer
icon: kMyScriptIcon,
// to allow access via SetExtrasInfo
app:kScriptIconPkgName,
// function to call when icon is tapped
tapAction: kTapScript
}
);
Vista de página 715
1 2 ... 711 712 713 714 715 716 717 718 719 720 721 ... 941 942

Comentários a estes Manuais

Sem comentários