Package | Top Level |
Class | public class Application |
appetizer
global object.
This class dispatches the following events:
Name | Type | Dispatched... |
---|---|---|
trayIconMenuOpening | MenuOpening | when the tray icon menu is about to be displayed |
dockItemMenuOpening | DockItemMenuOpening | when a dock item menu is about to be displayed |
dockItemClick | DockItemClick | when a dock item is clicked |
ready | Ready | when the application is fully ready |
close | Close | when the application is about to be closed |
See also
Method | Defined by | ||
---|---|---|---|
addEventListener(eventName:String, callback:String):void
This method lets you register event listener functions with the specified control or object.
| Application | ||
close():void
Closes the application.
| Application | ||
disable():void
Disables the application.
| Application | ||
doMultiLaunch():void
Triggers multi-launch functionality.
| Application | ||
enable(enable:Boolean = true):void
Enables the application.
| Application | ||
getDataDirectory():String
Gets the application data directory
| Application | ||
getDirectory():String
Gets the application directory
| Application | ||
Gets the dock item with the given id or
nil if it does not exist or has been deleted. | Application | ||
Returns the root of all the dock items.
| Application | ||
getDrive():String
Returns the drive on which the application is running.
| Application | ||
getFilePath():String
Gets the application file path
| Application | ||
getOrientation():String
Gets the application orientation.
| Application | ||
getSkinNames():Array
Returns the list of skins currently installed.
| Application | ||
hide():void
Hides the application.
| Application | ||
installAutoRunFile():void
Installs Appetizer's autorun.inf file at the root of the current drive.
| Application | ||
isVisible():Boolean
Tells whether the application is visible or not.
| Application | ||
setOrientation(orientation:String):void
Sets the application orientation.
| Application | ||
setSkin(skinName:String):void
Switches the skin to the given skin name.
| Application | ||
show():void
Shows the application.
| Application | ||
showHelpFile(sectionName:String = ""):void
Opens the help file.
| Application |
addEventListener | () | method |
public function addEventListener(eventName:String, callback:String):void
This method lets you register event listener functions with the specified control or object.
The event listener functions always receive an event
object as a parameter. This
event has, among other, a sender
property which is a reference to the object that has
dispatched the event. This object may also have additional properties which depend on the
the event.
eventName:String — The event you wish to listen to.
|
|
callback:String — The Lua function to call when the event is triggered.
|
function appetizer_trayIconMenuOpening(event) trace("Sender: "..event.sender) -- the application is the sender -- The tray icon menu is about to be shown, but before it is -- we add a menu item to it. menu = event.menu -- get the tray icon menu menu:appendSeparator() menuItem = MenuItem:new("Tray Icon Test") menu:append(menuItem) end appetizer:addEventListener("trayIconMenuOpening", "appetizer_trayIconMenuOpening") trace("Listening to the "trayIconMenuOpening" event...")
close | () | method |
public function close():void
Closes the application.
disable | () | method |
doMultiLaunch | () | method |
public function doMultiLaunch():void
Triggers multi-launch functionality. See Appetizer's help file for some information about this feature.
enable | () | method |
public function enable(enable:Boolean = true):void
Enables the application.
Parametersenable:Boolean (default = true ) — Sets this to false to disable the application instead
|
See also
getDataDirectory | () | method |
public function getDataDirectory():String
Gets the application data directory
ReturnsString — The application data directory
|
getDirectory | () | method |
public function getDirectory():String
Gets the application directory
ReturnsString — The application directory
|
getDockItemById | () | method |
public function getDockItemById():DockItem
Gets the dock item with the given id or nil
if it does not exist or has been deleted. Note
that this function will also look for the dock item in all the groups and subgroups starting from the root.
DockItem —
The dock item or nil if does not exists.
|
getDockItemsRoot | () | method |
public function getDockItemsRoot():DockItem
Returns the root of all the dock items. Dock items are organized in a tree-like structure
with groups being the branches and the shortcut being the leafs. This function allows getting the
root of this structure. You can then call childrenCount()
, getChildAt()
, etc. to
access the children.
DockItem —
The root of all the dock items.
|
root = appetizer:getDockItemsRoot() childrenCount = root:childrenCount() for i = 0, (childrenCount - 1) do subDockItem = root:getChildAt(i) trace(subDockItem:getName()) end
getDrive | () | method |
public function getDrive():String
Returns the drive on which the application is running.
ReturnsString — Drive name.
|
getFilePath | () | method |
public function getFilePath():String
Gets the application file path
ReturnsString — The application file path
|
getOrientation | () | method |
public function getOrientation():String
Gets the application orientation.
ReturnsString — Can be "horizontal" or "vertical".
|
See also
getSkinNames | () | method |
public function getSkinNames():Array
Returns the list of skins currently installed.
ReturnsArray — The list of string names.
|
hide | () | method |
public function hide():void
Hides the application.
installAutoRunFile | () | method |
public function installAutoRunFile():void
Installs Appetizer's autorun.inf file at the root of the current drive.
isVisible | () | method |
public function isVisible():Boolean
Tells whether the application is visible or not.
ReturnsBoolean — true if the application is visible.
|
function hideShowToggle() if appetizer:isVisible() then appetizer:hide() else appetizer:show() end end hideShowToggle()
setOrientation | () | method |
public function setOrientation(orientation:String):void
Sets the application orientation.
Parametersorientation:String — Can be "horizontal" or "vertical".
|
function rotateApplication() if appetizer:getOrientation() == "horizontal" then appetizer:setOrientation("vertical") else appetizer:setOrientation("horizontal") end end rotateApplication()
setSkin | () | method |
public function setSkin(skinName:String):void
Switches the skin to the given skin name. Use getSkinNames
to get the list of possible skins.
skinName:String — The skin name.
|
See also
show | () | method |
public function show():void
Shows the application.
showHelpFile | () | method |
public function showHelpFile(sectionName:String = ""):void
Opens the help file.
ParameterssectionName:String (default = " ") — The section to open the help file at.
|