Example: Volume control using seekbar

In this example we will learn how to use the seekbar widget to change the system volume.

Adding the Seekbar

Go to edit mode, press the button to add a widget. Choose "add seekbar".
Move the seekbar to its position and set its properties. Set the width to 350 (or any value you like), the min to 0 and the max to 100.
Under Action on change, add a "Network Event" -> "EventGhost". Give an event name (e.g. "System.SetVolume") and add the String "${value}" as payload.
Leave the edit mode. You should test the seekbar by dragging it once. In EventGhost, you should see your event with the value of your seekbar as payload.

The EventGhost Part

Now comes the tricky part. We have to use a python script to set the volume. Add a macro to EventGhost and choose the action "Python Script", then enter the line "eg.plugins.System.SetMasterVolume(float(eg.event.payload[1]))".
For explanation: "eg.event.payload[1]" is the value of the seekbar. (payload[0] is the ip) This comes as a string so we have to cast it to a float value. The rest of the line just sets the system volume. Having this, you can add your Event to the Macro by drag and drop. It should look like this:
This does the trick. When you now change the seekbar's position, your system volume changes.
Next tutorial: Example: Getting Volume Information