Gdk.Atom

Fields

None

Methods

class

intern (atom_name, only_if_exists)

class

intern_static_string (atom_name)

name ()

Details

class Gdk.Atom

An opaque type representing a string as an index into a table of strings on the X server.

classmethod intern(atom_name, only_if_exists)[source]
Parameters:
  • atom_name (str) – a string.

  • only_if_exists (bool) – if True, GDK is allowed to not create a new atom, but just return %GDK_NONE if the requested atom doesn’t already exists. Currently, the flag is ignored, since checking the existance of an atom is as expensive as creating it.

Returns:

the atom corresponding to atom_name.

Return type:

Gdk.Atom

Finds or creates an atom corresponding to a given string.

classmethod intern_static_string(atom_name)[source]
Parameters:

atom_name (str) – a static string

Returns:

the atom corresponding to atom_name

Return type:

Gdk.Atom

Finds or creates an atom corresponding to a given string.

Note that this function is identical to Gdk.Atom.intern() except that if a new Gdk.Atom is created the string itself is used rather than a copy. This saves memory, but can only be used if the string will always exist. It can be used with statically allocated strings in the main program, but not with statically allocated memory in dynamically loaded modules, if you expect to ever unload the module again (e.g. do not use this function in GTK+ theme engines).

New in version 2.10.

name()[source]
Returns:

a newly-allocated string containing the string corresponding to self. When you are done with the return value, you should free it using GLib.free().

Return type:

str

Determines the string corresponding to an atom.