gtk-traymanager-1.0.1: A wrapper around the eggtraymanager library for Linux system trays

Safe Haskell | None
Language | Haskell2010

Graphics.UI.Gtk.Misc.TrayManager

Contents

- Types
- Functions
- Signals

Description

This module implements a TrayManager - an integral part of a Linux system tray widget, though it is not itself a widget. This package exports a single GObject (for use with gtk2hs) that implements the freedesktop.org system tray specification (it handles receiving events and translating them into convenient signals, along with the messy work of dealing with XEMBED).

The basic usage of the object is to:

1. Instantiate the object with `trayManagerNew`
2. Have it manage a specific screen with `trayManagerManageScreen`
3. Set up handlers for the events exposed by the tray (e.g., `trayIconAdded`).

As an example, a functional system tray widget looks something like:

    import Graphics.UI.Gtk
    import Graphics.UI.Gtk.Misc.TrayManager
    systrayNew = do
      box <- hBoxNew False 5
      trayManager <- rayManagerNew
      Just screen <- screenGetDefault
      trayManagerManageScreen trayManager screen
      on trayManager trayIconAdded $ \w -> do
        widgetShowAll w
        boxPackStart box w PackNatural 0

Note that the widgets made available in the event handlers are not shown by default; you need to explicitly show them if you want that (and you probably do).

Synopsis

- data TrayManager
- type TrayManagerChild = Ptr EggTrayManagerChild
- class GObjectClass o => TrayManagerClass o
- castToTrayManager :: GObjectClass o => o -> TrayManager
- toTrayManager :: TrayManagerClass o => o -> TrayManager
- gTypeTrayManager :: GType
- trayManagerCheckRunning :: Screen -> IO Bool
- trayManagerNew :: IO TrayManager
- trayManagerManageScreen :: TrayManager -> Screen -> IO Bool
- trayManagerGetChildTitle :: TrayManager -> TrayManagerChild -> IO String
- trayIconAdded :: TrayManagerClass self => Signal self (Widget -> IO ())
- trayIconRemoved :: TrayManagerClass self => Signal self (Widget -> IO ())
- trayMessageSent :: TrayManagerClass self => Signal self (Widget -> String -> Int64 -> Int64 -> IO ())
- trayMessageCanceled :: TrayManagerClass self => Signal self (Widget -> Int64 -> IO ())
- trayLostSelection :: TrayManagerClass self => Signal self (IO ())

# Types

data TrayManager Source #

#### Instances

Instances details

Eq TrayManager Source # |
Instance details Defined in Graphics.UI.Gtk.Misc.TrayManager Methods (==) :: TrayManager -> TrayManager -> Bool Source # (/=) :: TrayManager -> TrayManager -> Bool Source #
Ord TrayManager Source # |

Instance details

Defined in Graphics.UI.Gtk.Misc.TrayManager

Methods

compare :: TrayManager -> TrayManager -> Ordering Source #

(<) :: TrayManager -> TrayManager -> Bool Source #

(<=) :: TrayManager -> TrayManager -> Bool Source #

(>) :: TrayManager -> TrayManager -> Bool Source #

(>=) :: TrayManager -> TrayManager -> Bool Source #

max :: TrayManager -> TrayManager -> TrayManager Source #

min :: TrayManager -> TrayManager -> TrayManager Source #

GObjectClass TrayManager Source # |
Instance details Defined in Graphics.UI.Gtk.Misc.TrayManager Methods toGObject :: TrayManager -> GObject Source # unsafeCastGObject :: GObject -> TrayManager Source #
TrayManagerClass TrayManager Source # |
Instance details Defined in Graphics.UI.Gtk.Misc.TrayManager

type TrayManagerChild = Ptr EggTrayManagerChild Source #

class GObjectClass o => TrayManagerClass o Source #

#### Instances

Instances details

TrayManagerClass TrayManager Source # |
Instance details Defined in Graphics.UI.Gtk.Misc.TrayManager

castToTrayManager :: GObjectClass o => o -> TrayManager Source #

toTrayManager :: TrayManagerClass o => o -> TrayManager Source #

gTypeTrayManager :: GType Source #

# Functions

trayManagerCheckRunning :: Screen -> IO Bool Source #

trayManagerNew :: IO TrayManager Source #

trayManagerManageScreen :: TrayManager -> Screen -> IO Bool Source #

trayManagerGetChildTitle :: TrayManager -> TrayManagerChild -> IO String Source #

# Signals

trayIconAdded :: TrayManagerClass self => Signal self (Widget -> IO ()) Source #

The signal emitted when a new tray icon is added. These are delivered even for systray icons that already exist when the tray manager is created.

trayIconRemoved :: TrayManagerClass self => Signal self (Widget -> IO ()) Source #

This signal is emitted when a tray icon is removed by its parent application. No action is really necessary here (the icon is removed without any intervention). You could do something here if you wanted, though.

trayMessageSent :: TrayManagerClass self => Signal self (Widget -> String -> Int64 -> Int64 -> IO ()) Source #

This signal is emitted when the application that displayed an icon wants a semi-persistent notification displayed for its icon. The standard doesn't seem to require that these be honored.

trayMessageCanceled :: TrayManagerClass self => Signal self (Widget -> Int64 -> IO ()) Source #

Similarly, the applciation can send this to cancel a previous persistent message.

trayLostSelection :: TrayManagerClass self => Signal self (IO ()) Source #

??