./python_api

Generated with ROBODoc v4.99.6 on Mon Nov 15 21:51:28 2004

### TABLE OF CONTENTS

- Bar/createBar
- Bar/deleteBar
- Bar/getBarImage
- Bar/getBarMinMax
- Bar/getBarPos
- Bar/getBarSensor
- Bar/getBarSize
- Bar/getBarValue
- Bar/getBarVertical
- Bar/getThemeBar
- Bar/hideBar
- Bar/moveBar
- Bar/resizeBar
- Bar/setBarImage
- Bar/setBarMinMax
- Bar/setBarSensor
- Bar/setBarValue
- Bar/setBarVertical
- Bar/showBar
- Config/addMenuConfigOption
- Config/readConfigEntry
- Config/readMenuConfigOption
- Config/setMenuConfigOption
- Config/writeConfigEntry
- Graph/createGraph
- Graph/deleteGraph
- Graph/getGraphColor
- Graph/getGraphMinMax
- Graph/getGraphPos
- Graph/getGraphSensor
- Graph/getGraphSize
- Graph/getGraphValue
- Graph/getThemeGraph
- Graph/hideGraph
- Graph/moveGraph
- Graph/resizeGraph
- Graph/setGraphColor
- Graph/setGraphMinMax
- Graph/setGraphSensor
- Graph/setGraphValue
- Graph/showGraph
- Image/addImageTooltip
- Image/changeImageChannelIntensity
- Image/changeImageIntensity
- Image/changeImageToGray
- Image/createBackgroundImage
- Image/createImage
- Image/createTaskIcon
- Image/deleteImage
- Image/getImageHeight
- Image/getImagePath
- Image/getImagePos
- Image/getImageSensor
- Image/getImageSize
- Image/getImageWidth
- Image/getThemeImage
- Image/hideImage
- Image/moveImage
- Image/removeImageEffects
- Image/removeImageTransformations
- Image/resizeImage
- Image/resizeImageSmooth
- Image/rotateImage
- Image/setImagePath
- Image/setImageSensor
- Image/showImage
- Menu/addMenuItem
- Menu/addMenuSeparator
- Menu/createMenu
- Menu/deleteMenu
- Menu/popupMenu
- Menu/removeMenuItem
- Misc/acceptDrops
- Misc/attachClickArea
- Misc/createClickArea
- Misc/execute
- Misc/executeInteractive
- Misc/getIp
- Misc/getNumberOfDesktop
- Misc/getThemePath
- Misc/hide
- Misc/openTheme
- Misc/show
- Misc/toggleShowDesktop
- Misc/translateAll
- RichText/changeRichText
- RichText/changeRichTextFont
- RichText/changeRichTextSize
- RichText/createRichText
- RichText/deleteRichText
- RichText/getRichTextFont
- RichText/getRichTextFontSize
- RichText/getRichTextPos
- RichText/getRichTextSensor
- RichText/getRichTextSize
- RichText/getRichTextValue
- RichText/getThemeRichText
- RichText/hideRichText
- RichText/moveRichText
- RichText/resizeRichText
- RichText/setRichTextSensor
- RichText/setRichTextWidth
- RichText/showRichText
- Systray/createSystray
- Systray/getCurrentWindowCount
- Systray/hideSystray
- Systray/moveSystray
- Systray/showSystray
- Systray/updateSystrayLayout
- Task/getStartupInfo
- Task/getStartupList
- Task/getTaskInfo
- Task/getTaskList
- Task/getTaskNames
- Task/performTaskAction
- Text/changeText
- Text/changeTextColor
- Text/changeTextFont
- Text/changeTextShadow
- Text/changeTextSize
- Text/createText
- Text/deleteText
- Text/getTextAlign
- Text/getTextColor
- Text/getTextFont
- Text/getTextFontSize
- Text/getTextPos
- Text/getTextSensor
- Text/getTextShadow
- Text/getTextSize
- Text/getTextValue
- Text/getThemeText
- Text/hideText
- Text/moveText
- Text/resizeText
- Text/setTextAlign
- Text/setTextSensor
- Text/showText
- Widget/createWidgetMask
- Widget/getWidgetPosition
- Widget/moveWidget
- Widget/redrawWidget
- Widget/redrawWidgetBackground
- Widget/resizeWidget
- Widget/toggleWidgetRedraw

## Widget/createWidgetMask

[top]

SYNOPSIS

long createWidgetMask(widget, mask)

DESCRIPTION

This function doesn't work currently due to a bug in KDE. Please use MASK= in your .theme file for the time being.

ARGUMENTS

- long widget -- karamba
- string mask -- The name of the widget mask file.

RETURN VALUE

1 if successful

## Widget/getWidgetPosition

[top]

SYNOPSIS

tuple getWidgetPosition(widget)

DESCRIPTION

Returns a Python Tuple containing the x and y position of you widget. widget is a reference to the current widget.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

position of the widget

## Widget/moveWidget

[top]

SYNOPSIS

long moveWidget(widget, x, y)

DESCRIPTION

Moves your karamba widget to a new screen location

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if successful

## Widget/redrawWidget

[top]

SYNOPSIS

long redrawWidget(widget)

DESCRIPTION

This is THE most important function. After you do a bunch of other calls (moving images, adding images or text, etc), you call this to update the widget display area. You will not see your changes until you call this. Redraws widget background.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Widget/redrawWidgetBackground

[top]

SYNOPSIS

long redrawWidgetBackground(widget)

DESCRIPTION

Redraws widget background.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Widget/resizeWidget

[top]

SYNOPSIS

long resizeWidget(widget, w, h)

DESCRIPTION

Resizes your karamba widget to width=w, height=h

ARGUMENTS

- long widget -- karamba
- long w -- width
- long h -- height

RETURN VALUE

1 if successful

## Widget/toggleWidgetRedraw

[top]

SYNOPSIS

long toggleWidgetRedraw(widget, b)

DESCRIPTION

Toggles widget redraw.

ARGUMENTS

- long widget -- karamba
- long b -- 1 = widget is drawn

RETURN VALUE

1 if successful

## Text/changeText

[top]

SYNOPSIS

long changeText(widget, text, value)

DESCRIPTION

This will change the contents of a text widget.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- long value -- new value

RETURN VALUE

1 if successful

## Text/changeTextColor

[top]

SYNOPSIS

long changeTextColor(widget, text, r, g, b)

DESCRIPTION

This will change the color of a text widget (only ones you created through python currently). textToChange is the reference to the text object to change that you saved from the createText() call. r, g, b are ints from 0 to 255 that represent red, green, and blue.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- long red -- red component of color
- long green -- green component of color
- long blue -- blue component of color

RETURN VALUE

1 if successful

## Text/changeTextFont

[top]

SYNOPSIS

long changeTextFont(widget, text, font)

DESCRIPTION

This will change the font of a text widget (only ones you created through python currently). textToChange is the reference to the text object to change that you saved from the createText() call. newFont is a string the the name of the font to use.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- string font -- font name

RETURN VALUE

1 if successful

## Text/changeTextShadow

[top]

SYNOPSIS

long changeTextShadow(widget, text, shadow)

DESCRIPTION

This will change the shadow size of a text widget (only ones you created through python currently). textToChange is the reference to the text object to change that you saved from the createText() call. size is the offset of the shadow in pixels. 1 or 2 is a good value in most cases. Get current sensor string

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- long shadow -- shadow offset

RETURN VALUE

1 if successful

## Text/changeTextSize

[top]

SYNOPSIS

long changeTextSize(widget, text, size)

DESCRIPTION

This will change the font size of a text widget (only ones you created through python currently). textToChange is the reference to the text object to change that you saved from the createText() call. size is the new font point size.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- long size -- new size for text

RETURN VALUE

1 if successful

## Text/createText

[top]

SYNOPSIS

long createText(widget, x, y, w, h, text)

DESCRIPTION

This creates a text at x,y with width and height w,h. You need to save the return value of this function to call other functions on your text field, such as changeText()

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long w -- width
- long h -- height
- string text -- text for the textlabel

RETURN VALUE

Pointer to new text meter

## Text/deleteText

[top]

SYNOPSIS

long deleteText(widget, text)

DESCRIPTION

This removes a text object from memory. Please do not call functions on "text" after calling deleteText, as it does not exist anymore and that could cause crashes in some cases.

ARGUMENTS

- long widget -- karamba
- long widget -- text

RETURN VALUE

1 if successful

## Text/getTextAlign

[top]

SYNOPSIS

string getTextAlign(widget, text)

DESCRIPTION

Get current text align.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

LEFT, CENTER or RIGHT

## Text/getTextColor

[top]

SYNOPSIS

tuple getTextColor(widget, text)

DESCRIPTION

Get current text color

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

(red, green, blue)

## Text/getTextFont

[top]

SYNOPSIS

string getTextFont(widget, text)

DESCRIPTION

Get current text font name

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

font name

## Text/getTextFontSize

[top]

SYNOPSIS

long getTextFontSize(widget, text)

DESCRIPTION

Get current text font size

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

text font size

## Text/getTextPos

[top]

SYNOPSIS

tuple getTextPos(widget, text)

DESCRIPTION

Given a reference to a text object, this will return a tuple containing the x and y coordinate of a text object.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

pos

## Text/getTextSensor

[top]

SYNOPSIS

string getTextSensor(widget, text)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

sensor string

## Text/getTextShadow

[top]

SYNOPSIS

long getTextShadow(widget, text)

DESCRIPTION

Get current shadow offset

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

shadow offset

## Text/getTextSize

[top]

SYNOPSIS

tuple getTextSize(widget, text)

DESCRIPTION

Given a reference to a text object, this will return a tuple containing the height and width of a text object.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

size

## Text/getTextValue

[top]

SYNOPSIS

string getTextValue(widget, text)

DESCRIPTION

Returns current text value.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

value

## Text/getThemeText

[top]

SYNOPSIS

long getThemeText(widget, name)

DESCRIPTION

You can reference text in your python code that was created in the theme file. Basically, you just add a NAME= value to the TEXT line in the .theme file. Then if you want to use that object, instead of calling createText, you can call this function.

The name you pass to the function is the same one that you gave it for the NAME= parameter in the .theme file.

ARGUMENTS

- long widget -- karamba
- string name -- name of the text to get

RETURN VALUE

Pointer to text

## Text/hideText

[top]

SYNOPSIS

long hideText(widget, text)

DESCRIPTION

Hides text that is visible. You need to call redrawWidget() afterwords to actually hide the text on screen.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

1 if successful

## Text/moveText

[top]

SYNOPSIS

long moveText(widget, text, x, y)

DESCRIPTION

This moves a text object to a new x, y relative to your widget. In other words, (0,0) is the top corner of your widget, not the screen.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if successful

## Text/resizeText

[top]

SYNOPSIS

long resizeText(widget, text, w, h)

DESCRIPTION

This will resize text to new height and width.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- long w -- new width
- long h -- new height

RETURN VALUE

1 if successful

## Text/setTextAlign

[top]

SYNOPSIS

long setTextAlign(widget, text, align)

DESCRIPTION

Sets text label align.

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- string align -- LEFT, CENTER or RIGHT

RETURN VALUE

1 if successful

## Text/setTextSensor

[top]

SYNOPSIS

long setTextSensor(widget, text, sensor)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text
- string sensor -- new sensor as in theme files

RETURN VALUE

1 if successful

## Text/showText

[top]

SYNOPSIS

long showText(widget, text)

DESCRIPTION

Shows text that has been hidden with hideText()

ARGUMENTS

- long widget -- karamba
- long text -- pointer to text

RETURN VALUE

1 if successful

## Task/getStartupInfo

[top]

SYNOPSIS

list getStartupInfo(widget, task)

DESCRIPTION

This returns all of the info about a certain starting task in the form of a Python List. widget is a reference to the current widget. task is a reference to the window you want info about which you obtain by calling getStartupList().

ARGUMENTS

- long widget -- karamba
- long task -- pointer to task

RETURN VALUE

Here is the format of the returned list by index value:

- 0 = Task name (The full name of the window)
- 1 = Icon name
- 2 = Executable name
- 3 = A reference back to the task you got info on

## Task/getStartupList

[top]

SYNOPSIS

list getTaskList(widget)

DESCRIPTION

This returns a Python List object with references to all the current windows that are in the process of loading on this system. You can then call getStartupInfo() on any of the entries in the list.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

startup list

## Task/getTaskInfo

[top]

SYNOPSIS

list getTaskInfo(widget, task)

DESCRIPTION

This returns all of the info about a certain task in the form of a Python List. widget is a reference to the current widget. task is a reference to the window you want info about which you obtain by calling getTaskList().

ARGUMENTS

- long widget -- karamba
- long task -- pointer to task

RETURN VALUE

Here is the format of the returned list by index value:

- 0 = Task name (The full name of the window)
- 1 = Icon name
- 2 = Class name - This is for grouping tasks. All tasks with the same name can be grouped together because they are instances of the same program.
- 3 = Desktop number - The desktop number this window is on
- 4 = Is this window maximized? 0=no, 1=yes
- 5 = Is this window iconified (minimized)? 0=no, 1=yes
- 6 = Is this window shaded (rolled up)? 0=no, 1=yes
- 7 = Is this window focused? 0=no, 1=yes
- 8 = A reference back to the task you got info on

## Task/getTaskList

[top]

SYNOPSIS

list getTaskList(widget)

DESCRIPTION

This returns a Python List object with references to all the current windows open on this system. You can then call performTaskAction() or getTaskInfo() on any of the entries in the list.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

Task list

## Task/getTaskNames

[top]

SYNOPSIS

list getTaskNames(widget)

DESCRIPTION

This returns a Python List containing the String names of all open windows on the system. This is for convience if you want to list open windows or see if a window by a certain name exists. Anything else requires the reference to the window you would obtain from getTaskList()

ARGUMENTS

- long widget -- karamba

RETURN VALUE

Task list

## Task/performTaskAction

[top]

SYNOPSIS

long performTaskAction(widget, task, action)

DESCRIPTION

This peforms the given action on a task object. widget is a reference to the current widget. task is a reference to a task object you got from getTaskList(). Action is a number from 1 to 10. See the list below.

Possible actions:

- 1 = Maximize the window
- 2 = Restore the window (use on iconified windows)
- 3 = Iconify the window (minimize it)
- 4 = Close the window
- 5 = Activate (give focus to) the window
- 6 = Raise the window
- 7 = Lower the window
- 8 = Smart Focus/Minimize - This will what the KDE taskbar does when you click on a window. If it is iconified, raise it. If it has focus, iconify it.
- 9 = Toggle whether this window is always on top
- 10 = Toggle wheter this window is shaded (rolled up)

ARGUMENTS

- long widget -- karamba
- long task -- pointer to task
- long action -- action number

RETURN VALUE

1 if successful

## Systray/createSystray

[top]

SYNOPSIS

long createSystray(widget, x, y, w, h)

DESCRIPTION

??

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long w -- width
- long h -- height

RETURN VALUE

1 if successful

## Systray/getCurrentWindowCount

[top]

SYNOPSIS

long getCurrentWindowCount(widget)

DESCRIPTION

??

ARGUMENTS

- long widget -- karamba

RETURN VALUE

window count

## Systray/hideSystray

[top]

SYNOPSIS

long hideSystray(widget)

DESCRIPTION

??

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Systray/moveSystray

[top]

SYNOPSIS

long moveSystray(widget, x, y, w, h)

DESCRIPTION

??

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long w -- width
- long h -- height

RETURN VALUE

1 if successful

## Systray/showSystray

[top]

SYNOPSIS

long showSystray(widget)

DESCRIPTION

??

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Systray/updateSystrayLayout

[top]

SYNOPSIS

long getCurrentWindowCount(widget)

DESCRIPTION

??

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## RichText/changeRichText

[top]

SYNOPSIS

long changeRichText(widget, richtext, value)

DESCRIPTION

This will change the contents of a rich text widget. richText is the reference to the text object to change that you saved from the createRichText() call. text is a string containing the new value for the rich text object.

The differance between Rich Text and a regular text field is that rich text fields can display HTML code embedded in your text.

In a <a href="command"> ... </a> tag command is executed if the link is click with the left mouse button.

Except if command starts with an '#' (ie: href="#value" ) the callback meterClicked is called with value (without the #) as the meter argument.

Also inline images work. Unfortunatly currently only when using absolute paths.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- string value -- new text

RETURN VALUE

1 if successful

## RichText/changeRichTextFont

[top]

SYNOPSIS

long changeRichTextFont(widget, richtext, font)

DESCRIPTION

This will change the font of a richtext widget.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- string font -- name of the new font

RETURN VALUE

1 if successful

## RichText/changeRichTextSize

[top]

SYNOPSIS

long changeRichTextSize(widget, richtext, size)

DESCRIPTION

This will change the font size of a richtext widget.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- long size -- new font point size

RETURN VALUE

1 if successful

## RichText/createRichText

[top]

SYNOPSIS

long createRichText(widget, text, underlineLinks)

DESCRIPTION

This creates creates a rich text string. underlineLinks is a boolean that determines if html links will be automatically underlined so that the user knows that the links can be clicked on. You need to save the return value of this function to call other functions on your rich text field, such as changeRichText().

The differance between Rich Text and a regular text field is that rich text fields can display HTML code embedded in your text.

In a <a href="command"> ... </a> tag command is executed if the link is click with the left mouse button.

Except if command starts with an '#' (ie: href="#value" ) the callback meterClicked is called with value (without the #) as the meter argument.

Also inline images work. Unfortunatly currently only when using absolute paths.

ARGUMENTS

- long widget -- karamba
- string text -- text for richtext
- long underlineLinks -- should the links be underlined

RETURN VALUE

Pointer to new richtext meter

## RichText/deleteRichText

[top]

SYNOPSIS

long deleteRichText(widget, richtext)

DESCRIPTION

This removes a richt text object from memory. Please do not call functions on "text" after calling deleteRichText, as it does not exist anymore and that could cause crashes in some cases.

ARGUMENTS

- long widget -- karamba
- long widget -- richtext

RETURN VALUE

1 if successful

## RichText/getRichTextFont

[top]

SYNOPSIS

string getRichTextFont(widget, richtext)

DESCRIPTION

This will get the font of a richtext widget.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

font name

## RichText/getRichTextFontSize

[top]

SYNOPSIS

long getRichTextFontSize(widget, richtext)

DESCRIPTION

This will get the font size of a richtext widget.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

font point size

## RichText/getRichTextPos

[top]

SYNOPSIS

tuple getRichTextPos(widget, richtext)

DESCRIPTION

Given a reference to a richtext object, this will return a tuple containing the x and y coordinate of a richtext object.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

pos

## RichText/getRichTextSensor

[top]

SYNOPSIS

string getRichTextSensor(widget, richtext)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

sensor string

## RichText/getRichTextSize

[top]

SYNOPSIS

tuple getRichTextSize(widget, richtext)

DESCRIPTION

Given a reference to a richtext object, this will return a tuple containing the height and width of a richtext object.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

size

## RichText/getRichTextValue

[top]

SYNOPSIS

string getRichTextValue(widget, richtext)

DESCRIPTION

Returns current richtext value.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

value

## RichText/getThemeRichText

[top]

SYNOPSIS

long getThemeRichText(widget, name)

DESCRIPTION

You can reference richtext in your python code that was created in the theme file. Basically, you just add a NAME= value to the GRAPH line in the .theme file. Then if you want to use that object, instead of calling createRichText, you can call this function.

The name you pass to the function is the same one that you gave it for the NAME= parameter in the .theme file.

ARGUMENTS

- long widget -- karamba
- string name -- name of the richtext to get

RETURN VALUE

Pointer to richtext

## RichText/hideRichText

[top]

SYNOPSIS

long hideRichText(widget, richtext)

DESCRIPTION

This hides an richtext. In other words, during subsequent calls to widgetUpdate(), this richtext will not be drawn.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

1 if successful

## RichText/moveRichText

[top]

SYNOPSIS

long moveRichText(widget, richtext, x, y)

DESCRIPTION

This moves a text object to a new x, y relative to your widget. In other words, (0,0) is the top corner of your widget, not the screen.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if successful

## RichText/resizeRichText

[top]

SYNOPSIS

long resizeRichText(widget, richtext, w, h)

DESCRIPTION

This will resize richtext to new height and width.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- long w -- new width
- long h -- new height

RETURN VALUE

1 if successful

## RichText/setRichTextSensor

[top]

SYNOPSIS

long setRichTextSensor(widget, richtext, sensor)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- string sensor -- new sensor as in theme files

RETURN VALUE

1 if successful

## RichText/setRichTextWidth

[top]

SYNOPSIS

long setRichTextWidth(widget, richtext, width)

DESCRIPTION

Given a reference to a rich text object, this function changes it's width to the specified value in pixels.

The height adjusts automatically as the contents are changed with changeRichText.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext
- long width -- new width in pixels

RETURN VALUE

1 if successful

## RichText/showRichText

[top]

SYNOPSIS

long showRichText(widget, richtext)

DESCRIPTION

This shows an richtext. In other words, during subsequent calls to widgetUpdate(), this richtext will be drawn.

ARGUMENTS

- long widget -- karamba
- long richtext -- pointer to richtext

RETURN VALUE

1 if successful

## Misc/acceptDrops

[top]

SYNOPSIS

long acceptDrops(widget)

DESCRIPTION

Calling this enables your widget to receive Drop events. In other words, the user will be able to drag icons from her desktop and drop them on your widget. The "itemDropped" callback is called as a result with the data about the icon that was dropped on your widget. This allows, for example, icon bars where items are added to the icon bar by Drag and Drop.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Misc/attachClickArea

[top]

SYNOPSIS

long attachClickArea(widget, meter, lB, mB, rB)

DESCRIPTION

It is possible to attach a clickarea to a meter (image or text field), which is moved and resized correctly if the meter is moved or resized.

There is also a callback meterClicked(widget, meter, button) which is called whenever a meter is clicked (if something is attached to it). Given an Image or a TextLabel, this call makes it clickable. When a mouse click is detected, the callback meterClicked is called.

lB, mB, and rB are strings that specify what command is executed when this meter is clicked with the left mouse button, middle mouse button, and right mouse button respectively. If given, the appropriate command is executed when the mouse click is received.

The keyword arguments are all optional. If command is an empty string nothing is executed.

For now the command given to RightButton has obviosly no effect (because that brings up the SuperKaramba menu).

ARGUMENTS

- long widget -- karamba
- long meter -- pointer to meter
- string lB -- command to left mouse button
- string mB -- command to middle mouse button
- string rB -- command to right mouse button

RETURN VALUE

1 if successful

## Misc/createClickArea

[top]

SYNOPSIS

long createClickArea(widget, x, y, w, h, cmd_to_run)

DESCRIPTION

This creates a clickable area at x,y with width and height w,h. When this area is clicked, cmd_to_run will be executed. The mouse will change to the clickable icon when over this area.

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long w -- width
- long h -- height
- string cmd_to_run -- command to be run

RETURN VALUE

1 if successful

## Misc/execute

[top]

SYNOPSIS

long execute(widget, command)

DESCRIPTION

This command simply executes a program or command on the system. This is just for convience (IE you could accomplish this directly through python, but sometimes threading problems crop up that way). The only option is a string containing the command to execute.

ARGUMENTS

- long widget -- karamba
- string command -- command to execute

RETURN VALUE

1 if successful

## Misc/executeInteractive

[top]

SYNOPSIS

long executeInteractive(widget, command)

DESCRIPTION

This command executes a program or command on the system. But it allows you to get any text that the program outputs. Futhermore, it won't freeze up your widget while the command executes.

To use it, call executeInteractive with the reference to your widget and a list of command options. The array is simply a list that contains the command as the first entry, and each option as a seperate list entry. Output from the command is returned via the commandOutput callback.

The command returns the process number of the command. This is useful if you want to run more than one program at a time. The number will allow you to figure out which program is outputting in the commandOutput callback.

Example: Run the command "ls -la *.zip"

myCommand = ["ls", "-la", "*.zip"] karamba.executeInteractive(widget, myCommand)

ARGUMENTS

- long widget -- karamba
- string command -- command to execute

RETURN VALUE

1 if successful

## Misc/getIp

[top]

SYNOPSIS

string getIp(widget, interface_name)

DESCRIPTION

get current IP address of the interface_name interface.

ARGUMENTS

- long widget -- karamba
- string interface_name -- name of the interface to get ip

RETURN VALUE

ip address

## Misc/getNumberOfDesktop

[top]

SYNOPSIS

long getNumberOfDesktop(widget)

DESCRIPTION

Returns number fo desktops

ARGUMENTS

- long widget -- karamba

RETURN VALUE

number of desktops

## Misc/getThemePath

[top]

SYNOPSIS

string getThemePath(widget)

DESCRIPTION

Returns a string containing the directory where your theme was loaded from.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

path to theme

## Misc/hide

[top]

SYNOPSIS

string hide(widget)

DESCRIPTION

hide theme

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Misc/openTheme

[top]

SYNOPSIS

long openTheme(theme)

DESCRIPTION

Opens new theme.

ARGUMENTS

- string theme -- path to new theme

RETURN VALUE

1 if successful

## Misc/show

[top]

SYNOPSIS

string show(widget)

DESCRIPTION

show theme

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Misc/toggleShowDesktop

[top]

SYNOPSIS

long toggleShowDesktop(widget)

DESCRIPTION

This shows/hides the current desktop just like the Show Desktop button on kicker. Basically, it minimizes all the windows on the current desktop. Call it once to show the desktop and again to hide it.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

1 if successful

## Misc/translateAll

[top]

SYNOPSIS

long translateAll(widget, relative_x, relative_y)

DESCRIPTION

Moves all widgets within a theme in a particular direction relative from the previous spot without moving the parent theme widget.

ARGUMENTS

- long widget -- karamba
- long translate_x -- move horizontally
- long translate_y -- move vertically

RETURN VALUE

1 if successful

## Menu/addMenuItem

[top]

SYNOPSIS

long addMenuItem(widget, menu, text, icon)

DESCRIPTION

This adds an entry to the given menu with label text and with given icon. icon can be just an application name in which case the user's current icon set is used, or can be a path to a 16x16 png file.

The function returns the id of the menu item, which identifies that popup menu item uniquely among popupmenu items application-wide or returns 0 if the given menu doesn't exist.

ARGUMENTS

- long widget -- karamba
- long menu -- pointer to menu
- string text -- text for menu item
- string icon -- icon

RETURN VALUE

menu item id

## Menu/addMenuSeparator

[top]

SYNOPSIS

long addMenuSeparator(widget, menu)

DESCRIPTION

This adds an menu separator to the given menu.

ARGUMENTS

- long widget -- karamba
- long menu -- pointer to menu

RETURN VALUE

menu item id

## Menu/createMenu

[top]

SYNOPSIS

long createMenu(widget)

DESCRIPTION

This creates an empty popup menu and returns a pointer to the menu.

ARGUMENTS

- long widget -- karamba

RETURN VALUE

pointer to menu

## Menu/deleteMenu

[top]

SYNOPSIS

long deleteMenu(widget, menu)

DESCRIPTION

This deletes the referenced menu if that menu exists.

ARGUMENTS

- long widget -- karamba
- long menu -- pointer to menu

RETURN VALUE

1 if menu existed and was deleted, returns 0 otherwise.

## Menu/popupMenu

[top]

SYNOPSIS

long popupMenu(widget, menu, x, y)

DESCRIPTION

This pops up the given menu at the given co-ordinates. The co-ordinates are relative to the widget, not the screen. You can use negative co-ordinates to make a menu appear to the right of or above your theme.

ARGUMENTS

- long widget -- karamba
- long menu -- pointer to menu
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if the menu existed and was popped up, returns 0 otherwise.

## Menu/removeMenuItem

[top]

SYNOPSIS

long removeMenuItem(widget, menu, id)

DESCRIPTION

This removes the item with given id from given menu if that menu exists.

ARGUMENTS

- long widget -- karamba
- long menu -- pointer to menu
- long id -- menu item id

RETURN VALUE

1 if the menu item existed and was removed or returns zero otherwise.

## Image/addImageTooltip

[top]

SYNOPSIS

long addImageTooltip(widget, image, text)

DESCRIPTION

This creats a tooltip for image with tooltip_text.

Note:

- If you move the image, the tooltip does not move! It stays! Do not create a tooltip if the image is off-screen because you will not be able to ever see it.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- string text -- tooltip text

RETURN VALUE

1 if successful

## Image/changeImageChannelIntensity

[top]

SYNOPSIS

long changeImageChannelIntensity(widget, image, ratio, channel, millisec)

DESCRIPTION

Changes the "intensity" of the image color channel, which is similar to it's brightness.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- float ratio -- -1.0 to 1.0 (dark to bright)
- string channel -- color channel (red|green|blue)
- long millisec -- milliseconds before the image is restored

RETURN VALUE

1 if successful

## Image/changeImageIntensity

[top]

SYNOPSIS

long changeImageIntensity(widget, image, ratio, millisec)

DESCRIPTION

Changes the "intensity" of the image, which is similar to it's brightness. ratio is a floating point number from -1.0 to 1.0 that determines how much to brighten or darken the image. Millisec specifies how long in milliseconds before the image is restored to it's original form. This is useful for "mouse over" type animations. Using 0 for millisec disables this feature and leaves the image permanently affected.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- float ratio -- -1.0 to 1.0 (dark to bright)
- long millisec -- milliseconds before the image is restored

RETURN VALUE

1 if successful

## Image/changeImageToGray

[top]

SYNOPSIS

long changeImageToGray(widget, image, millisec)

DESCRIPTION

Turns the given image into a grayscale image. Millisec specifies how long in milliseconds before the image is restored to it's original form. This is useful for "mouse over" type animations. Using 0 for millisec disables this feature and leaves the image permanently affected.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- long millisec -- milliseconds before the image is restored

RETURN VALUE

1 if successful

## Image/createBackgroundImage

[top]

SYNOPSIS

long createBackgroundImage(widget, x, y, w, h, image)

DESCRIPTION

This creates an background image on your widget at x, y. The filename should be given as the path parameter. In theory the image could be local or could be a url. It works just like adding an image in your theme file. You will need to save the return value to be able to call other functions on your image, such as moveImage()

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- string image -- image for the imagelabel

RETURN VALUE

Pointer to new image meter

## Image/createImage

[top]

SYNOPSIS

long createImage(widget, x, y, image)

DESCRIPTION

This creates an image on your widget at x, y. The filename should be given as the path parameter. In theory the image could be local or could be a url. It works just like adding an image in your theme file. You will need to save the return value to be able to call other functions on your image, such as moveImage()

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- string image -- image for the imagelabel

RETURN VALUE

Pointer to new image meter

## Image/createTaskIcon

[top]

SYNOPSIS

long createTaskIcon(widget, x, y, ctask)

DESCRIPTION

This creates a task image at x,y.

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long task -- task

RETURN VALUE

Pointer to new image meter

## Image/deleteImage

[top]

SYNOPSIS

long deleteImage(widget, image)

DESCRIPTION

This removes image from memory. Please do not call functions on "image" after calling deleteImage, as it does not exist anymore and that could cause crashes in some cases.

ARGUMENTS

- long widget -- karamba
- long widget -- image

RETURN VALUE

1 if successful

## Image/getImageHeight

[top]

SYNOPSIS

long getImageSize(widget, image)

DESCRIPTION

This returns the height of an image. This is useful if you have rotated an image and its size changed, so you do not know how big it is anymore.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

height

## Image/getImagePath

[top]

SYNOPSIS

string getImagePath(widget, image)

DESCRIPTION

Returns current image path.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

path

## Image/getImagePos

[top]

SYNOPSIS

tuple getImagePos(widget, image)

DESCRIPTION

Given a reference to a image object, this will return a tuple containing the x and y coordinate of a image object.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

pos

## Image/getImageSensor

[top]

SYNOPSIS

string getImageSensor(widget, image)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

sensor string

## Image/getImageSize

[top]

SYNOPSIS

tuple getImageSize(widget, image)

DESCRIPTION

Given a reference to a image object, this will return a tuple containing the height and width of a image object.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

size

## Image/getImageWidth

[top]

SYNOPSIS

long getImageSize(widget, image)

DESCRIPTION

This returns the width of an image. This is useful if you have rotated an image and its size changed, so you do not know how big it is anymore. // ARGUMENTS * long widget -- karamba * long image -- pointer to image

RETURN VALUE

width

## Image/getThemeImage

[top]

SYNOPSIS

long getThemeImage(widget, name)

DESCRIPTION

You can reference an image in your python code that was created in the .theme file. Basically, you just add a NAME= value to the IMAGE line in the .theme file. Then if you want to use that object, instead of calling createImage, you can call this function.

The name you pass to the function is the same one that you gave it for the NAME= parameter in the .theme file.

ARGUMENTS

- long widget -- karamba
- string name -- name of the image to get

RETURN VALUE

Pointer to image

## Image/hideImage

[top]

SYNOPSIS

long hideImage(widget, image)

DESCRIPTION

This hides an image. In other words, during subsequent calls to widgetUpdate(), this image will not be drawn.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

1 if successful

## Image/moveImage

[top]

SYNOPSIS

long moveImage(widget, image, x, y)

DESCRIPTION

This moves an image to a new x, y relative to your widget. In other words, (0,0) is the top corner of your widget, not the screen. The imageToMove parameter is a reference to the image to move that you saved as the return value from createImage()

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if successful

## Image/removeImageEffects

[top]

SYNOPSIS

long removeImageEffects(widget, image)

DESCRIPTION

If you have called image effect commands on your image (ex: changeImageIntensity), you can call this to restore your image to it's original form.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

1 if successful

## Image/removeImageTransformations

[top]

SYNOPSIS

long removeImageTransformations(widget, image)

DESCRIPTION

If you have rotated or resized your image, you can call this to restore your image to it's original form.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

1 if successful

## Image/resizeImage

[top]

SYNOPSIS

long resizeImage(widget, image, w, h)

DESCRIPTION

This resizes your image to width, height. The imageToResize parameter is a reference to an image that you saved as the return value from createImage()

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- long w -- width
- long h -- height

RETURN VALUE

1 if successful

## Image/resizeImageSmooth

[top]

SYNOPSIS

long resizeImageSmooth(widget, image, w, h)

DESCRIPTION

DEPRECATED: resizeImage now allows the user to pick whether to use fast or smooth resizing from the SuperKaramba menu - This resizes your image to width, height. The imageToResize parameter is a reference to an image that you saved as the return value from createImage()

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- long w -- width
- long h -- height

RETURN VALUE

1 if successful

## Image/rotateImage

[top]

SYNOPSIS

long rotateImage(widget, image, deg)

DESCRIPTION

This rotates your image to by the specified amount of degrees. The imageToRotate parameter is a reference to an image that you saved as the return value from createImage()

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- long deg -- degrees to rotate

RETURN VALUE

1 if successful

## Image/setImagePath

[top]

SYNOPSIS

long setImagePath(widget, image, path)

DESCRIPTION

This will change image of a image widget.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- long path -- new path

RETURN VALUE

1 if successful

## Image/setImageSensor

[top]

SYNOPSIS

long setImageSensor(widget, image, sensor)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image
- string sensor -- new sensor as in theme files

RETURN VALUE

1 if successful

## Image/showImage

[top]

SYNOPSIS

long showImage(widget, image)

DESCRIPTION

This shows a previously hidden image. It does not actually refresh the image on screen. That is what redrawWidget() does.

ARGUMENTS

- long widget -- karamba
- long image -- pointer to image

RETURN VALUE

1 if successful

## Graph/createGraph

[top]

SYNOPSIS

long createGraph(widget, x, y, w, h, points)

DESCRIPTION

This creates a graph at x,y with width and height w,h.

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long w -- width
- long h -- height
- long points -- Number of points in graph

RETURN VALUE

Pointer to new graph meter

## Graph/deleteGraph

[top]

SYNOPSIS

long deleteGraph(widget, graph)

DESCRIPTION

This deletes graph.

ARGUMENTS

- long widget -- karamba
- long widget -- graph

RETURN VALUE

1 if successful

## Graph/getGraphColor

[top]

SYNOPSIS

tuple getGraphColor(widget, graph)

DESCRIPTION

Get current graph color

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

(red, green, blue)

## Graph/getGraphMinMax

[top]

SYNOPSIS

tuple getGraphMinMax(widget, graph)

DESCRIPTION

Returns current graph value.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

min & max

## Graph/getGraphPos

[top]

SYNOPSIS

tuple getGraphPos(widget, graph)

DESCRIPTION

Given a reference to a graph object, this will return a tuple containing the x and y coordinate of a graph object.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

pos

## Graph/getGraphSensor

[top]

SYNOPSIS

string getGraphSensor(widget, graph)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

sensor string

## Graph/getGraphSize

[top]

SYNOPSIS

tuple getGraphSize(widget, graph)

DESCRIPTION

Given a reference to a graph object, this will return a tuple containing the height and width of a graph object.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

size

## Graph/getGraphValue

[top]

SYNOPSIS

long getGraphValue(widget, graph)

DESCRIPTION

Returns current graph value.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

value

## Graph/getThemeGraph

[top]

SYNOPSIS

long getThemeGraph(widget, name)

DESCRIPTION

You can reference graph in your python code that was created in the theme file. Basically, you just add a NAME= value to the GRAPH line in the .theme file. Then if you want to use that object, instead of calling createGraph, you can call this function.

The name you pass to the function is the same one that you gave it for the NAME= parameter in the .theme file.

ARGUMENTS

- long widget -- karamba
- string name -- name of the graph to get

RETURN VALUE

Pointer to graph

## Graph/hideGraph

[top]

SYNOPSIS

long hideGraph(widget, graph)

DESCRIPTION

This hides an graph. In other words, during subsequent calls to widgetUpdate(), this graph will not be drawn.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

1 if successful

## Graph/moveGraph

[top]

SYNOPSIS

long moveGraph(widget, graph, x, y)

DESCRIPTION

This will move graph to new x and y coordinates.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if successful

## Graph/resizeGraph

[top]

SYNOPSIS

long resizeGraph(widget, graph, w, h)

DESCRIPTION

This will resize graph to new height and width.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph
- long w -- new width
- long h -- new height

RETURN VALUE

1 if successful

## Graph/setGraphColor

[top]

SYNOPSIS

tuple setGraphColor(widget, graph, red, green, blue)

DESCRIPTION

Set current graph color

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph
- long red -- red component of color
- long green -- green component of color
- long blue -- blue component of color

RETURN VALUE

1 if successful

## Graph/setGraphMinMax

[top]

SYNOPSIS

long setGraphMinMax(widget, graph, min, max)

DESCRIPTION

Returns current graph value.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph
- long min -- min value
- long max -- max value

RETURN VALUE

1 if successful

## Graph/setGraphSensor

[top]

SYNOPSIS

long setGraphSensor(widget, graph, sensor)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph
- string sensor -- new sensor as in theme files

RETURN VALUE

1 if successful

## Graph/setGraphValue

[top]

SYNOPSIS

long setGraphValue(widget, graph, value)

DESCRIPTION

Sets current graph value.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph
- long value -- new value

RETURN VALUE

1 if successful

## Graph/showGraph

[top]

SYNOPSIS

long showGraph(widget, graph)

DESCRIPTION

This shows an graph. In other words, during subsequent calls to widgetUpdate(), this graph will be drawn.

ARGUMENTS

- long widget -- karamba
- long graph -- pointer to graph

RETURN VALUE

1 if successful

## Config/addMenuConfigOption

[top]

SYNOPSIS

long addMenuConfigOption(widget, key, name)

DESCRIPTION

SuperKaramba supports a simplistic configuration pop-up menu. This menu appears when you right-click on a widget and choose Configure Theme. Basically, it allows you to have check-able entrys in the menu to allow the user to enable or disable features in your theme.

Before you use any configuration menu stuff, you NEED to add a new callback to your script:

def menuOptionChanged(widget, key, value):

This will get called whenever a config menu option is changed. Now you can add items to the config menu:

addMenuConfigOption(widget, String key, String name)

Key is the name of a key value where the value will be saved automatically into the widget's config file. Name is the actual text that will show up in the config menu.

For example, I could allow the user to enable or disable a clock showing up in my theme:

karamba.addMenuConfigOption(widget, "showclock", "Display a clock")

ARGUMENTS

- long widget -- karamba
- string key -- key for menu item
- string name -- name of the graph to get

RETURN VALUE

1 if successful

## Config/readConfigEntry

[top]

SYNOPSIS

string|long readConfigEntry(widget, key, value)

DESCRIPTION

This function reads an entry from the config file with the given key.

ARGUMENTS

- long widget -- karamba
- string key -- key for config item

RETURN VALUE

config value for key

## Config/readMenuConfigOption

[top]

SYNOPSIS

long readMenuConfigOption(widget, key)

DESCRIPTION

This returns whether or not the given option is checked in the theme's Configure Theme menu.

See addMenuConfigOption for a more detailed explanation.

ARGUMENTS

- long widget -- karamba
- string key -- key for menu item

RETURN VALUE

0 is returned if it is not checked and 1 is returned if it is.

## Config/setMenuConfigOption

[top]

SYNOPSIS

long setMenuConfigOption(widget, key, value)

DESCRIPTION

This sets whether or not the given option is checked in the theme's Configure Theme menu. Value should be 0 if key should not be checked and 1 if key should be checked.

See addMenuConfigOption for a more detailed explanation.

ARGUMENTS

- long widget -- karamba
- string key -- key for menu item
- int value -- 1 if checked

RETURN VALUE

1 if successful

## Config/writeConfigEntry

[top]

SYNOPSIS

long writeConfigEntry(widget, key, value)

DESCRIPTION

SuperKaramba automatically supports configuration files for each theme. These files will be saved in /your/home/dir/.superkaramba/ and will be named themenamerc where themename is the name of the theme.

This function writes an entry into the config file with the given key and value.

For example, to save my favorite color, I would do karamba.writeConfigEntry(widget, "FavColor", "Red")

ARGUMENTS

- long widget -- karamba
- string key -- key for config item
- string value -- config value

RETURN VALUE

1 if successful

## Bar/createBar

[top]

SYNOPSIS

long createBar(widget, x, y, w, h, image)

DESCRIPTION

This creates a bar at x,y with width and height w,h.

ARGUMENTS

- long widget -- karamba
- long x -- x coordinate
- long y -- y coordinate
- long w -- width
- long h -- height
- string image -- Path to image

RETURN VALUE

Pointer to new bar meter

## Bar/deleteBar

[top]

SYNOPSIS

long deleteBar(widget, bar)

DESCRIPTION

This deletes bar.

ARGUMENTS

- long widget -- karamba
- long widget -- bar

RETURN VALUE

1 if successful

## Bar/getBarImage

[top]

SYNOPSIS

string getBarImage(widget, bar)

DESCRIPTION

Get bar image

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

path to bar image

## Bar/getBarMinMax

[top]

SYNOPSIS

tuple getBarMinMax(widget, bar)

DESCRIPTION

Returns current bar value.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

min & max

## Bar/getBarPos

[top]

SYNOPSIS

tuple getBarPos(widget, bar)

DESCRIPTION

Given a reference to a bar object, this will return a tuple containing the x and y coordinate of a bar object.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

pos

## Bar/getBarSensor

[top]

SYNOPSIS

string getBarSensor(widget, bar)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

sensor string

## Bar/getBarSize

[top]

SYNOPSIS

tuple getBarSize(widget, bar)

DESCRIPTION

Given a reference to a bar object, this will return a tuple containing the height and width of a bar object.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

size

## Bar/getBarValue

[top]

SYNOPSIS

long getBarValue(widget, bar)

DESCRIPTION

Returns current bar value.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

value

## Bar/getBarVertical

[top]

SYNOPSIS

string getBarVertical(widget, bar)

DESCRIPTION

Check if bar is vertical bar

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

1 if vertical

## Bar/getThemeBar

[top]

SYNOPSIS

long getThemeBar(widget, name)

DESCRIPTION

You can reference bar in your python code that was created in the theme file. Basically, you just add a NAME= value to the BAR line in the .theme file. Then if you want to use that object, instead of calling createBar, you can call this function.

The name you pass to the function is the same one that you gave it for the NAME= parameter in the .theme file.

ARGUMENTS

- long widget -- karamba
- string name -- name of the bar to get

RETURN VALUE

Pointer to bar

## Bar/hideBar

[top]

SYNOPSIS

long hideBar(widget, bar)

DESCRIPTION

This hides an bar. In other words, during subsequent calls to widgetUpdate(), this bar will not be drawn.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

1 if successful

## Bar/moveBar

[top]

SYNOPSIS

long moveBar(widget, bar, x, y)

DESCRIPTION

This will move bar to new x and y coordinates.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- long x -- x coordinate
- long y -- y coordinate

RETURN VALUE

1 if successful

## Bar/resizeBar

[top]

SYNOPSIS

long resizeBar(widget, bar, w, h)

DESCRIPTION

This will resize bar to new height and width.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- long w -- new width
- long h -- new height

RETURN VALUE

1 if successful

## Bar/setBarImage

[top]

SYNOPSIS

long setBarImage(widget, bar, image)

DESCRIPTION

Get bar image

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- string image -- new image

RETURN VALUE

1 if successful

## Bar/setBarMinMax

[top]

SYNOPSIS

long setBarMinMax(widget, bar, min, max)

DESCRIPTION

Returns current bar value.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- long min -- min value
- long max -- max value

RETURN VALUE

1 if successful

## Bar/setBarSensor

[top]

SYNOPSIS

long setBarSensor(widget, bar, sensor)

DESCRIPTION

Get current sensor string

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- string sensor -- new sensor as in theme files

RETURN VALUE

1 if successful

## Bar/setBarValue

[top]

SYNOPSIS

long setBarValue(widget, bar, value)

DESCRIPTION

Sets current bar value.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- long value -- new value

RETURN VALUE

1 if successful

## Bar/setBarVertical

[top]

SYNOPSIS

long setBarVertical(widget, bar)

DESCRIPTION

Set bar vertical

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar
- long vertical -- 1 if vertical

RETURN VALUE

1 if successful

## Bar/showBar

[top]

SYNOPSIS

long showBar(widget, bar)

DESCRIPTION

This shows an bar. In other words, during subsequent calls to widgetUpdate(), this bar will be drawn.

ARGUMENTS

- long widget -- karamba
- long bar -- pointer to bar

RETURN VALUE

1 if successful