KXMessages

KDE 4.2 PyKDE API Reference

- KDE's Python API

# KXMessages Class Reference

`from PyKDE4.kdeui import *`

Inherits: QWidget → QObject

## Detailed Description

Sending string messages to other applications using the X Client Messages.

Used internally by KStartupInfo. You usually don't want to use this, use DBUS instead.

Author:
  Lubos Lunak <l.lunak@kde.org>

## Signals
| gotMessage (QString message)
## Methods
| __init__ (self, QString accept_broadcast, QWidget parent, bool obsolete)
| __init__ (self, QString accept_broadcast=NULL, QWidget parent=NULL)
| broadcastMessage (self, QString msg_type, QString message, int screen, bool obsolete)
| broadcastMessage (self, QString msg_type, QString message)
| gotMessage (self, QString message)
| sendMessage (self, WId w, QString msg_type, QString message, bool obsolete)
| sendMessage (self, WId w, QString msg_type, QString message)
bool | x11Event (self, XEvent ev)
## Static Methods
bool | broadcastMessageX (Display disp, QString msg_type, QString message, int screen, bool obsolete)
bool | broadcastMessageX (Display disp, QString msg_type, QString message)
bool | sendMessageX (Display disp, WId w, QString msg_type, QString message, bool obsolete)
bool | sendMessageX (Display disp, WId w, QString msg_type, QString message)

## Method Documentation

__init__ | ( | self, |
|  | QString | accept_broadcast,
|  | QWidget | parent,
|  | bool | obsolete
| ) |  |  |

Creates an instance which will receive X messages.

Parameters:

  | accept_broadcast | if non-NULL, all broadcast messages with this message type will be received.
  | parent | the parent of this widget
  | obsolete | always set to false (needed for backwards compatibility with KDE3.1 and older)

__init__ | ( | self, |
|  | QString | accept_broadcast=NULL,
|  | QWidget | parent=NULL
| ) |  |  |

Deprecated:
  This method is equivalent to the other constructor with obsolete = true.

broadcastMessage | ( | self, |
|  | QString | msg_type,
|  | QString | message,
|  | int | screen,
|  | bool | obsolete
| ) |  |  |

Broadcasts the given message with the given message type.

Parameters:

  | msg_type | the type of the message
  | message | the message itself
  | screen | X11 screen to use, -1 for the default
  | obsolete | always set to false (needed for backwards compatibility with KDE3.1 and older)

broadcastMessage | ( | self, |
|  | QString | msg_type,
|  | QString | message
| ) |  |  |

Deprecated:
  This method is equivalent to broadcastMessage() with obsolete = true.

bool broadcastMessageX | ( | Display | disp,
|  | QString | msg_type,
|  | QString | message,
|  | int | screen,
|  | bool | obsolete
| ) |  |  |

Broadcasts the given message with the given message type.

Parameters:

  | disp | X11 connection which will be used instead of qt_x11display()
  | msg_type | the type of the message
  | message | the message itself
  | screen | X11 screen to use, -1 for the default
  | obsolete | always set to false (needed for backwards compatibility with KDE3.1 and older)

Returns:
  false when an error occurred, true otherwise

bool broadcastMessageX | ( | Display | disp,
|  | QString | msg_type,
|  | QString | message
| ) |  |  |

Deprecated:
  This method is equivalent to broadcastMessageX() with obsolete = true.

gotMessage | ( | self, |
|  | QString | message
| ) |  |  |

Emitted when a message was received.

Parameters:

  | message | the message that has been received

Signal syntax:
  `QObject.connect(source, SIGNAL("gotMessage(const QString&)"), target_slot)`

sendMessage | ( | self, |
|  | WId | w,
|  | QString | msg_type,
|  | QString | message,
|  | bool | obsolete
| ) |  |  |

Sends the given message with the given message type only to given window.

Parameters:

  | w | X11 handle for the destination window
  | msg_type | the type of the message
  | message | the message itself
  | obsolete | always set to false (needed for backwards compatibility with KDE3.1 and older)

sendMessage | ( | self, |
|  | WId | w,
|  | QString | msg_type,
|  | QString | message
| ) |  |  |

Deprecated:
  This method is equivalent to sendMessage() with obsolete = true.

bool sendMessageX | ( | Display | disp,
|  | WId | w,
|  | QString | msg_type,
|  | QString | message,
|  | bool | obsolete
| ) |  |  |

Sends the given message with the given message type only to given window.

Parameters:

  | disp | X11 connection which will be used instead of qt_x11display()
  | w | X11 handle for the destination window
  | msg_type | the type of the message
  | message | the message itself
  | obsolete | always set to false (needed for backwards compatibility with KDE3.1 and older)

Returns:
  false when an error occurred, true otherwise

bool sendMessageX | ( | Display | disp,
|  | WId | w,
|  | QString | msg_type,
|  | QString | message
| ) |  |  |

Deprecated:
  This method is equivalent to sendMessageX() with obsolete = true.

bool x11Event | ( | self, |
|  | XEvent | ev
| ) |  |  |

Internal: