my_notification = client.notify(
title='My Notification',
description='A description goes here',
no_growl=True,
icon='info'
)
By default, the CocoaDialog application comes with several built in icons for your use.
These icons are meant to be used as values for the global icon
parameter.
These parameters apply to most if not all dialog types.
If for some reason you notice that one of these options isn't working for your dialog type, try running the CocoaDialog wrapper with debugging enabled.
Accepted Type | Description | |
---|---|---|
string | The title shown at the top of the dialog box | |
boolean | Enable string output instead of dialog's default. For example, clicking on a button1 entitled "myButton" will return ["myButton"] rather than ["1"] |
|
boolean | Disable newlines in dialog's label attributes | |
integer, float | The desired width of the dialog in pixels | |
integer, float | The desired height of the dialog in pixels | |
integer, float | Distance away from the left side of the screen that the dialog should be spawned (in pixels) | |
integer, float | Distance away from the top of the screen that the dialog should be spawned (in pixels) | |
string | Icon (from global icons) that should be used in your dialog | |
integer, float | Time until the dialog dies | |
string | Format for displaying the time remaining in the timeout. Requires a string format character %s in order to show the time remaining |
|
string | Use the icon of the passed bundle ID in your dialog | |
string | Absolute path to the icon file to be used in your dialog | |
integer, float | Size of icon in dialog (in pixels) | |
integer, float | Height of your dialog's icon (in pixels) | |
integer, float | Width of your dialog's icon (in pixels) |
This is the listing of all available dialog types that the CocoaDialog wrapper currently supports.
A message box dialog used to either present the user with important information or to allow the user to make a custom selection.
Accepted Type | Description | Required | |
---|---|---|---|
string | The title of the notification | ||
string | The message of the notification | ||
boolean | Force the notification to stay displayed until clicked | ||
boolean | Disable the default use of the GrowlSDK | ||
integer, float | Value of alpha to be used (requires no_growl) |
||
string | Hex notation of color to used for text (requires no_growl) |
||
string | Hex notation of color to use for border (requires no_growl) |
||
string | Hex notation of color to use for the bottom of the background (requires no_growl) |
||
string | Hex notation of color to use for the top of the background (requires no_growl) |
$my_notification = $client->notify([
'title'=>'My Notification',
'description'=>'A description goes here',
'no_growl'=true,
'icon'=>'info'
]);
my_notification = client.notify(
title='My Notification',
description='A description goes here',
no_growl=True,
icon='info'
)
my_notification = @client.notify(
title:'My Notifiation',
description:'A description goes here',
no_growl:true,
icon:'info'
)
A dialog that allows you to present several checkable boxes. This is useful for allowing your user to select special settings to enable in your workflow.
Accepted Type | Description | Required | |
---|---|---|---|
string | The label above the list of checkboxes | ||
list | The labels for the available checkboxes in the dialog | ||
list | A list of checkbox indices to check by default (corresponds to items) | ||
list | A list of checkbox indices to disable by default (corresponds to items) | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
integer | The amount of available checkbox rows | ||
integer | The amount of available checkbox columns |
...
...
...
...
×A dialog that allows you to present multiple radio toggles. This is useful for allowing your user to enable or disable aspects of your workflow.
Accepted Type | Description | Required | |
---|---|---|---|
string | The label above the list of radio toggles | ||
list | The labels for the available radio toggles in the dialog | ||
list | A list of radio indices to select by default (corresponds to items) | ||
list | A list of radio indices to disable by default (corresponds to items) | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
integer | The amount of available radio toggle rows | ||
integer | The amount of available radio toggle columns |
...
...
...
...
×A dialog that presents the user with a movable slider widget. This dialog is useful for allowing your user to adjust some predefined quality.
Accepted Type | Description | Required | |
---|---|---|---|
string | The label above the slider widget | ||
boolean | Enable a second label to always show the slider's current value | ||
integer, float | The minimum value of the slider | ||
integer, float | The maximum value of the slider | ||
integer | The amount of ticks on the slider widget | ||
string | The label tied to the slider widget | ||
integer, float | The default value of the slider widget | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
boolean | Force the slider widget to return a float value |
...
...
...
...
×A message box dialog used to either present the user with important information or to allow the user to make a custom selection.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
boolean | Deny access to the cancel button (if available) | ||
boolean | Force dialog to float above all other windows |
$my_message_box = $client->msgbox([
'title'=>'My Message Box',
'text'=>'This is the heading of my message box',
'informative_text'='Informational text goes in here',
'button1'=>'Click Me!',
'button2'=>"Don't click me...",
'icon'=>'info'
]);
my_message_box = client.msgbox(
title='My Message Box',
text='This is the heading of my message box',
informative_text='Informational text goes in here',
button1='Click Me!',
button2='Don\'t click me...',
icon='info'
)
my_message_box = @client.msgbox(
title:'My Message Box',
text:'This is the heading of my message box',
informative_text:'Informational text goes in here',
button1:'Click Me!',
button2:'Don\'t click me...',
icon:'info'
)
Unless the string_output
parameter is set to true, the msgbox dialog returns the number of the button selected by the user as a string in an array. Suppose that the user clicks the button with the label Click Me!
The msgbox dialog would then return...
["1"]
×
A simplified version of the msgbox dialog. This dialog has predefined buttons, used for presenting the user with a simple informational dailog.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
boolean | Deny access to the cancel button (if available) | ||
boolean | Force dialog to float above all other windows |
...
...
...
A variation of the ok_msgbox dialog. This dialog has predefined buttons, used for presenting the user with a simple informational dailog.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
boolean | Deny access to the cancel button (if available) | ||
boolean | Force dialog to float above all other windows |
...
...
...
A input box dialog used to take input from the user. Used for allowing a user to accept somekind of specific string.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
boolean | Deny access to the cancel button (if available) | ||
boolean | Force dialog to float above all other windows | ||
boolean | Force input widget to mask input (password like) |
...
...
...
A simplified version of the inputbox dialog. This dialog has predefined buttons used for asking the user for simple input.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
boolean | Deny access to the cancel button (if available) | ||
boolean | Force dialog to float above all other windows | ||
boolean | Force input widget to mask input (password like) |
...
...
...
A secured input box dialog used to take input from the user. Useful for allowing the user to enter some kind of password.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
boolean | Force dialog to float above all other windows |
...
...
...
A combination of the secure and standard inputbox dialogs. This dialog has predefined buttons and a secure input field.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
boolean | Deny access to the cancel button (if available) | ||
boolean | Force dialog to float above all other windows |
...
...
...
This dialog allows you to navigate and select a file off the system. This dialog is useful for asking a user to select some file.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
boolean | Allow the user to select directories as well as files | ||
boolean | Force the user to only select directories | ||
boolean | Allow the user to make multiple selections | ||
list | Force the user to only select files with an extension from this list | ||
string | Absolute path to directory to select by default | ||
string | Absolute path to file to select by default |
...
...
...
This dialog allows you to navigate and select a file off the system. This dialog is useful for asking a user to select some file.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
boolean | Treat package files as directories | ||
boolean | Don't allow users to create directories from the dialog | ||
list | Force the user to only save files with an extension from this list | ||
string | Absolute path to directory to select by default | ||
string | Absolute path to file to select by default |
...
...
...
A box with a large textbox widget. Used to allow the user to view or edit the contents of a file.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
string | The light text below the the subheader used for displaying a message | ||
string | Absolute path to file from which to load text into the textbox widget | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
boolean | Allow the user to edit the text in the textbox widget | ||
boolean | Focus on the textbox widget on dialog spawn | ||
boolean | Select all the text in the textbox widget on dialog spawn | ||
string | Scroll down to the given text in the textbox widget | ||
boolean | Force dialog to float above all other windows |
...
...
...
A box with a dropdown widget. Used to allow the user to select a single element from some list.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
list | The available items in the dropdown widget | ||
string | The default and right-most button's label | ||
string | The center-most button's label | ||
string | The left-most button's label | ||
boolean | Enable the pulldown style for the dropdown widget | ||
boolean | Exit the dialog as soon as the dropdown selection is changed | ||
boolean | Force dialog to float above all other windows |
...
...
...
A simplified version of the dropdown dialog. This dialog has predefined buttons.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
list | The available items in the dropdown widget | ||
boolean | Enable the pulldown style for the dropdown widget | ||
boolean | Exit the dialog as soon as the dropdown selection is changed | ||
boolean | Force dialog to float above all other windows |
...
...
...
A dialog that allows you to present a progress bar to the user. This is useful for showing the progress of some process.
Accepted Type | Description | Required | |
---|---|---|---|
string | The bold text shown as a subheader in the dialog | ||
integer, float | The percent of the progress bar on dialog spawn | ||
boolean | Force the dialog to show an indeterminate progress bar | ||
boolean | Allow the progress bar dialog to be stopped | ||
boolean | Force dialog to float above all other windows |
Description | |||
---|---|---|---|
text percent |
1 if dialog is still alive 0 if dialog is dead |
Updates the state of the progress bar. Parameters are passed explicitly |
|
0 |
Kills the current instance of the progress bar. Refrain from using this method. |
...
...
...