KDE 4.7 PyKDE API Reference

- KDE's Python API

# KSelectionWatcher Class Reference

`from PyKDE4.kdeui import *`

Inherits: QObject

## Detailed Description

This class implements watching manager selections, as described in the ICCCM section 2.8. It emits signal newOwner() when a new owner claim the selection, and emits lostOwner() when the selection ownership is given up. To find out current owner of the selection, owner() can be used. ICCCM manager selection watching

## Signals

| lostOwner ()
| newOwner (long owner)

## Methods

| __init__ (self, long selection, int screen=-1, QObject parent=NULL)
| __init__ (self, QString selection, int screen=-1, QObject parent=NULL)
long | owner (self)

## Signal Documentation

lostOwner | ( |  | ) |

This signal is emitted when the selection is given up, i.e. there's no owner. Note that the selection may be immediatelly claimed again, so the newOwner() signal may be emitted right after this one. It's safe to delete the instance in a slot connected to this signal.

Signal syntax:
  `QObject.connect(source, SIGNAL("lostOwner()"), target_slot)`

newOwner | ( | long | owner
| ) |  |  |

This signal is emitted when the selection is successfully claimed by a new owner.

Parameters:

  | owner | the new owner of the selection

Signal syntax:
  `QObject.connect(source, SIGNAL("newOwner(Window)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | long | selection,
|  | int | screen=-1,
|  | QObject | parent=NULL
| ) |  |  |

This constructor accepts the selection name and creates the appropriate atom for it automatically.

Parameters:

  | selection | name of the manager selection
  | screen | X screen, or -1 for default
  | parent | parent object, or NULL if there is none

__init__ | ( | self, |
|  | QString | selection,
|  | int | screen=-1,
|  | QObject | parent=NULL
| ) |  |  |

This constructor accepts the selection name and creates the appropriate atom for it automatically.

Parameters:

  | selection | name of the manager selection
  | screen | X screen, or -1 for default
  | parent | parent object, or NULL if there is none

long owner | ( |  | self ) |

Return the current owner of the manager selection, if any. Note that if the event informing about the owner change is still in the input queue, newOwner() might have been emitted yet.