Difference between revisions of "Application:get"

From GiderosMobile
m
(formatting)
Line 1: Line 1:
 +
__NOTOC__
 
'''Available since:''' Gideros 2015.7<br/>
 
'''Available since:''' Gideros 2015.7<br/>
 
 
'''Class:''' [[Application|Application]]<br/>
 
'''Class:''' [[Application|Application]]<br/>
  
 
=== Description ===
 
=== Description ===
 
Returns the state of the desktop setting provided as string parameter.
 
Returns the state of the desktop setting provided as string parameter.
 +
<source lang="lua">
 +
varies = application:get(setting)
 +
</source>
  
 +
=== Parameters ===
 +
'''setting''' (string) the name of the desktop setting
 +
 +
=== Return values ===
 +
'''Returns''' (varies) the value(s) of the setting
 +
 +
=== Examples ===
 
<source lang="lua">
 
<source lang="lua">
 
print(application:get("windowTitle"))
 
print(application:get("windowTitle"))
Line 12: Line 22:
 
print("\n")
 
print("\n")
  
-- print a list of all available settings
+
-- get the user download folder path
 +
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads
 +
</source>
 +
 
 +
Print a list of all available settings:
 +
<source lang="lua">
 
print(application:get("help"))
 
print(application:get("help"))
 
--[[
 
--[[
Line 48: Line 63:
 
0
 
0
 
]]
 
]]
 
-- get the user download folder path
 
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads
 
 
</source>
 
</source>
 
  
 
{{Application}}
 
{{Application}}

Revision as of 03:26, 26 August 2020

Available since: Gideros 2015.7
Class: Application

Description

Returns the state of the desktop setting provided as string parameter.

varies = application:get(setting)

Parameters

setting (string) the name of the desktop setting

Return values

Returns (varies) the value(s) of the setting

Examples

print(application:get("windowTitle"))
print(application:get("documentDirectory"))
print(application:get("temporaryDirectory"))
print("\n")

-- get the user download folder path
print(application:get("directory", "download")) -- prints C:/Users/xxx/Downloads

Print a list of all available settings:

print(application:get("help"))
--[[
	Accepted value for Desktop's application:get()
	- [x,y] windowPosition
	- [w,h] windowSize
	- [w,h] screenSize
	- [x,y] cursorPosition
	- [text] clipboard
	- [text] windowTitle
	- [path] directory(where//help)
	- [path] openDirectoryDialog(title|path//help)
	- [path] openFileDialog(title|path|extensions//help)
	- [path] saveFileDialog(title|path|extensions//help)
	- [path] documentDirectory
	- [path] temporaryDirectory
	0
]]
print("\n")

print(application:get("directory", "help"))
--[[
	Accepted value for directory :
	- executable
	- document
	- desktop
	- temporary
	- data
	- music
	- movies
	- pictures
	- cache
	- download
	- home
	0
]]