Functions¶
Details¶
- Gladeui.catalog_add_path(path)¶
- Parameters:
path (
str) – the new path containing catalogs
Adds a new path to the list of path to look catalogs for.
- Gladeui.catalog_destroy_all()¶
Destroy and free all resources related with every loaded catalog.
- Gladeui.catalog_get_extra_paths()¶
- Returns:
a list paths added by
Gladeui.Catalog.add_path()- Return type:
[
str]
- Gladeui.catalog_is_loaded(name)¶
- Gladeui.catalog_load_all()¶
- Returns:
the list of loaded
Gladeui.Catalog*- Return type:
Loads all available catalogs in the system. First loads catalogs from
Gladeui.ENV_CATALOG_PATH, then fromGladeui.App.get_catalogs_dir() and finally from paths specified withGladeui.Catalog.add_path()
- Gladeui.catalog_remove_path(path)¶
-
Remove path from the list of path to look catalogs for.
Noneto remove all paths.
- Gladeui.cursor_get_add_widget_pixbuf()¶
- Return type:
- Gladeui.cursor_init()¶
Initializes cursors for use with
Gladeui.Cursor.set().
- Gladeui.cursor_set(project, window, type)¶
- Parameters:
project (
Gladeui.Project) –window (
Gdk.Window) – aGdk.Windowtype (
Gladeui.CursorType) – aGladeui.CursorType
Sets the cursor for window to something appropriate based on type. (also sets the cursor on all visible project widgets)
- Gladeui.displayable_value_is_disabled(type, value)¶
- Parameters:
type (
GObject.GType) –value (
str) –
- Return type:
- Gladeui.displayable_value_set_disabled(type, value, disabled)¶
- Parameters:
type (
GObject.GType) –value (
str) –disabled (
bool) –
- Gladeui.get_displayable_value(type, value)¶
- Parameters:
type (
GObject.GType) –value (
str) –
- Return type:
- Gladeui.get_value_from_displayable(type, displayabe)¶
- Parameters:
type (
GObject.GType) –displayabe (
str) –
- Return type:
- Gladeui.init()¶
Initialization function for libgladeui (not
Gladeui.App) It builds paths, bind text domain, and register icons
- Gladeui.init_debug_flags()¶
- Gladeui.param_spec_objects(name, nick, blurb, accepted_type, flags)¶
- Parameters:
name (
str) –nick (
str) –blurb (
str) –accepted_type (
GObject.GType) –flags (
GObject.ParamFlags) –
- Returns:
a
GObject.ParamSpecdescribing a list ofGObject.Object- Return type:
- Gladeui.propert_get_insensitive_tooltip(property)¶
- Parameters:
property (
Gladeui.Property) –- Return type:
- Gladeui.property_def_get_default_from_spec(spec)¶
- Parameters:
spec (
GObject.ParamSpec) –- Return type:
- Gladeui.property_def_make_flags_from_string(type, string)¶
- Parameters:
type (
GObject.GType) –string (
str) –
- Return type:
- Gladeui.property_def_set_weights(properties, parent)¶
- Parameters:
properties ([
Gladeui.PropertyDef]) – a list ofGladeui.PropertyDefparent (
GObject.GType) – theGObject.GTypeof the parent
This function assigns “weight” to each property in its natural order staring from 1. If parent is 0 weight will be set for every
Gladeui.PropertyDefin the list. This function will not override weight if it is already set (weight >= 0.0)
- Gladeui.property_def_update_from_node(node, object_type, property_def_ref, domain)¶
- Parameters:
node (
Gladeui.XmlNode) – the property nodeobject_type (
GObject.GType) – theGObject.GTypeof the owning objectproperty_def_ref (
Gladeui.PropertyDeforNone) – a pointer to the property classdomain (
str) – the domain to translate catalog strings from
- Returns:
Trueon success. property_def_ref is set toNoneif the property has Disabled=”True".- property_def_ref:
a pointer to the property class
- Return type:
(
bool, property_def_ref:Gladeui.PropertyDeforNone)
Updates the property_def_ref with the contents of the node in the xml file. Only the values found in the xml file are overridden.
- Gladeui.register_displayable_value(type, value, domain, string)¶
- Parameters:
type (
GObject.GType) –value (
str) –domain (
str) –string (
str) –
- Gladeui.register_translated_value(type, value, string)¶
- Parameters:
type (
GObject.GType) –value (
str) –string (
str) –
- Gladeui.setup_log_handlers()¶
Sets up a log handler to manage all
GLib.LogLevelFlags.LEVEL_MASKerrors of domain: GLib, GLib-GObject.Object, Gtk, Gdk, and domainless.
- Gladeui.standard_boolean_spec()¶
- Returns:
a
GObject.ParamSpecdescribing a boolean- Return type:
- Gladeui.standard_float_spec()¶
- Returns:
a
GObject.ParamSpecdescribing a float- Return type:
- Gladeui.standard_gdkcolor_spec()¶
- Returns:
a
GObject.ParamSpecdescribing aGdk.Color- Return type:
- Gladeui.standard_int_spec()¶
- Returns:
a
GObject.ParamSpecdescribing an int- Return type:
- Gladeui.standard_objects_spec()¶
- Returns:
a
GObject.ParamSpecdescribing a list ofGObject.Object- Return type:
This was developed for the purpose of holding a list of ‘targets’ in an
Atk.Relation(we are setting it up as a property)
- Gladeui.standard_pixbuf_spec()¶
- Returns:
a
GObject.ParamSpecdescribing aGdkPixbuf.Pixbuf- Return type:
- Gladeui.standard_stock_image_spec()¶
- Returns:
a
GObject.ParamSpecdescribing a list of builtin stock image- Return type:
- Gladeui.standard_stock_spec()¶
- Returns:
a
GObject.ParamSpecdescribing a list of builtin stock item- Return type:
- Gladeui.standard_string_spec()¶
- Returns:
a
GObject.ParamSpecdescribing a string- Return type:
- Gladeui.standard_strv_spec()¶
- Returns:
a
GObject.ParamSpecdescribing an array of strings- Return type:
- Gladeui.standard_uint_spec()¶
- Returns:
a
GObject.ParamSpecdescribing an uint- Return type:
- Gladeui.type_has_displayable_values(type)¶
- Parameters:
type (
GObject.GType) –- Return type:
- Gladeui.util_canonical_path(path)¶
- Gladeui.util_check_and_warn_scrollable(parent, child_adaptor, parent_widget)¶
- Parameters:
parent (
Gladeui.Widget) –child_adaptor (
Gladeui.WidgetAdaptor) –parent_widget (
Gtk.Widget) –
- Return type:
- Gladeui.util_compare_stock_labels(a, b)¶
- Parameters:
a (
objectorNone) – a #gconstpointer to aGtk.StockItemb (
objectorNone) – a #gconstpointer to aGtk.StockItem
- Returns:
negative value if a < b; zero if a = b; positive value if a > b
- Return type:
This is a
GLib.CompareFuncthat compares the labels of two stock items, ignoring any ‘_’ characters. It isn’t particularly efficient.
- Gladeui.util_container_get_all_children(container)¶
- Parameters:
container (
Gtk.Container) – aGtk.Container- Returns:
a
GLib.Listgiving the contents of container- Return type:
Use this to itterate over all children in a
Gtk.Container, as it used _forall() instead of _foreach() (and the GTK+ version of this function is simply not exposed).
- Gladeui.util_count_placeholders(parent)¶
- Parameters:
parent (
Gladeui.Widget) – aGladeui.Widget- Returns:
the amount of
Gladeui.Placeholdersparented by parent- Return type:
- Gladeui.util_duplicate_underscores(name)¶
-
Duplicates name, but the copy has two underscores in place of any single underscore in the original.
- Gladeui.util_file_dialog_new(title, project, parent, action)¶
- Parameters:
title (
str) – dialog titleproject (
Gladeui.Project) – aGladeui.Projectused when savingparent (
Gtk.Window) – a parentGtk.Windowfor the dialogaction (
Gladeui.UtilFileDialogType) – aGladeui.UtilFileDialogTypeto say if the dialog will open or save
- Returns:
a “glade file” file chooser dialog. The caller is responsible for showing the dialog
- Return type:
- Gladeui.util_file_is_writeable(path)¶
-
Checks whether the file at path is writeable
- Gladeui.util_find_iter_by_widget(model, findme, column)¶
- Parameters:
model (
Gtk.TreeModel) – aGtk.TreeModelfindme (
Gladeui.Widget) – aGladeui.Widget
- Returns:
a newly allocated
Gtk.TreeIterfrom model corresponding to findme which should be freed withGtk.TreeIter.free()- Return type:
Looks through model for the
Gtk.TreeItercorresponding to findme under column.
- Gladeui.util_get_devhelp_icon(size)¶
- Parameters:
size (
Gtk.IconSize) – the preferred icon size- Returns:
- Return type:
Creates an image displaying the devhelp icon.
- Gladeui.util_get_file_mtime(filename)¶
- Parameters:
filename (
str) – A filename- Raises:
- Returns:
The mtime of the file, or %0 if the file attributes could not be read.
- Return type:
Gets the UTC modification time of file filename.
- Gladeui.util_get_placeholder_from_pointer(container)¶
- Parameters:
container (
Gtk.Container) – aGtk.Container- Returns:
- Return type:
- Gladeui.util_get_type_from_name(name, have_func)¶
- Parameters:
name (
str) – the name of theGObject.GType- like ‘Gtk.Widget' or a “get-type” function.have_func (
bool) – function-name flag – true if the name is a “get-type” function.
- Returns:
the new
GObject.GType- Return type:
Returns the type using the “get type” function name based on name. If the have_func flag is true,`name` is used directly, otherwise the get-type function is contrived from name then used.
- Gladeui.util_object_is_loading(object)¶
- Parameters:
object (
GObject.Object) – AGObject.Object- Returns:
Whether the object’s project is being loaded or not.
- Return type:
- Gladeui.util_read_prop_name(str)¶
-
Return a usable version of a property identifier as found in a freshly parserd #GladeInterface
- Gladeui.util_remove_scroll_events(widget)¶
- Parameters:
widget (
Gtk.Widget) –
- Gladeui.util_replace(str, a, b)¶
-
Replaces each occurrence of the character a in str to b.
- Gladeui.util_search_devhelp(book, page, search)¶
- Gladeui.util_url_show(url)¶
- Parameters:
url (
str) – An URL to display- Returns:
- Return type:
Portable function for showing an URL url in a web browser.
- Gladeui.utils_boolean_from_string(string)¶
- Parameters:
string (
str) – the string to convert- Returns:
Trueif there was an error on the conversion,Falseotherwise.- value:
return location
- Return type:
Parse a boolean value
- Gladeui.utils_cairo_draw_line(cr, color, x1, y1, x2, y2)¶
- Gladeui.utils_cairo_draw_rectangle(cr, color, filled, x, y, width, height)¶
- Gladeui.utils_enum_string_from_value(enum_type, value)¶
- Parameters:
enum_type (
GObject.GType) –value (
int) –
- Return type:
- Gladeui.utils_enum_string_from_value_displayable(flags_type, value)¶
- Parameters:
flags_type (
GObject.GType) –value (
int) –
- Return type:
- Gladeui.utils_enum_value_from_string(enum_type, strval)¶
- Parameters:
enum_type (
GObject.GType) –strval (
str) –
- Return type:
- Gladeui.utils_flags_string_from_value(enum_type, value)¶
- Parameters:
enum_type (
GObject.GType) –value (
int) –
- Return type:
- Gladeui.utils_flags_string_from_value_displayable(flags_type, value)¶
- Parameters:
flags_type (
GObject.GType) –value (
int) –
- Return type:
- Gladeui.utils_flags_value_from_string(enum_type, strval)¶
- Parameters:
enum_type (
GObject.GType) –strval (
str) –
- Return type:
- Gladeui.utils_get_pointer(widget, window, device, x, y)¶
- Parameters:
widget (
Gtk.Widget) – The widget to get the mouse position relative forwindow (
Gdk.Window) – The window of the current event, orNonedevice (
Gdk.Device) – The device, if not specified, the current event will be expected to have a device.x (
int) – The location to store the mouse pointer X positiony (
int) – The location to store the mouse pointer Y position
Get’s the pointer position relative to widget, while window and device are not absolutely needed, they should be passed wherever possible.
- Gladeui.utils_get_pspec_from_funcname(funcname)¶
- Parameters:
funcname (
str) – the symbol name of a function to generate aGObject.ParamSpec- Returns:
A
GObject.ParamSpeccreated by the delegate function specified by funcname- Return type:
- Gladeui.utils_hijack_key_press(win, event, user_data)¶
- Parameters:
win (
Gtk.Window) – aGtk.Windowevent (
Gdk.EventKey) – theGdk.EventKey
- Returns:
whether the event was handled
- Return type:
This function is meant to be attached to key-press-event of a toplevel, it simply allows the window contents to treat key events /before/ accelerator keys come into play (this way widgets dont get deleted when cutting text in an entry etc.). Creates a liststore suitable for comboboxes and such to chose from a variety of types.
- Gladeui.utils_liststore_from_enum_type(enum_type, include_empty)¶
- Parameters:
enum_type (
GObject.GType) – AGObject.GTypeinclude_empty (
bool) – whether to prepend an “Unset” slot
- Returns:
A new
Gtk.ListStore- Return type:
Creates a liststore suitable for comboboxes and such to chose from a variety of types.
- Gladeui.utils_pointer_mode_render_icon(mode, size)¶
- Parameters:
mode (
Gladeui.PointerMode) – theGladeui.PointerModeto render as iconsize (
Gtk.IconSize) – icon size
- Returns:
the rendered
GdkPixbuf.Pixbuf- Return type:
Render an icon representing the pointer mode. Best view with sizes bigger than
Gtk.IconSize.LARGE_TOOLBAR.
- Gladeui.utils_string_from_value(value)¶
- Parameters:
value (
GObject.Value) – aGObject.Valueto convert- Returns:
A newly allocated string
- Return type:
Serializes
GObject.Valueinto a string (using glade conversion routines)
- Gladeui.utils_value_from_string(type, string, project)¶
- Parameters:
type (
GObject.GType) – aGObject.GTypeto convert withstring (
str) – the string to convertproject (
Gladeui.Project) – theGladeui.Projectto look for formats of object names when needed
- Returns:
A newly allocated and set
GObject.Value- Return type:
Allocates and sets a
GObject.Valueof type type set to string (using glade conversion routines)
- Gladeui.xml_dump_from_context(context)¶
- Parameters:
context (
Gladeui.XmlContext) – aGladeui.XmlContext- Returns:
the XML string, free the allocated memory with
GLib.free() after use- Return type:
Dump the XML string from the context.
- Gladeui.xml_get_boolean(node, name, _default)¶
- Parameters:
node (
Gladeui.XmlNode) –name (
str) –_default (
bool) –
- Return type:
- Gladeui.xml_get_content(node_in)¶
- Parameters:
node_in (
Gladeui.XmlNode) – aGladeui.XmlNode- Returns:
A newly allocated string
- Return type:
Gets a string containing the content of node_in.
- Gladeui.xml_get_property_boolean(node_in, name, _default)¶
- Parameters:
node_in (
Gladeui.XmlNode) –name (
str) –_default (
bool) –
- Return type:
- Gladeui.xml_get_property_double(node_in, name, _default)¶
- Parameters:
node_in (
Gladeui.XmlNode) –name (
str) –_default (
float) –
- Return type:
- Gladeui.xml_get_property_int(node_in, name, _default)¶
- Parameters:
node_in (
Gladeui.XmlNode) –name (
str) –_default (
int) –
- Return type:
- Gladeui.xml_get_property_string(node_in, name)¶
- Parameters:
node_in (
Gladeui.XmlNode) –name (
str) –
- Return type:
- Gladeui.xml_get_property_string_required(node_in, name, xtra)¶
- Parameters:
node_in (
Gladeui.XmlNode) –name (
str) –xtra (
str) –
- Return type:
- Gladeui.xml_get_property_targetable_versions(node_in, name)¶
- Parameters:
node_in (
Gladeui.XmlNode) – aGladeui.XmlNodename (
str) – a property name
- Returns:
a list of
Gladeui.TargetableVersion- Return type:
Get the list of targetable versions for a property
- Gladeui.xml_get_property_version(node_in, name, major, minor)¶
- Parameters:
node_in (
Gladeui.XmlNode) –name (
str) –major (
int) –minor (
int) –
- Return type:
- Gladeui.xml_get_value_int(node_in, name, val)¶
- Parameters:
node_in (
Gladeui.XmlNode) – aGladeui.XmlNodename (
str) – a stringval (
int) – a pointer to an #int
- Returns:
- Return type:
Gets an integer value for a node either carried as an attribute or as the content of a child.
- Gladeui.xml_get_value_int_required(node, name, val)¶
- Parameters:
node (
Gladeui.XmlNode) – aGladeui.XmlNodename (
str) – a stringval (
int) – a pointer to an #int
- Returns:
Falseif name is not in node- Return type:
This is a wrapper around
Gladeui.xml_get_value_int(), only it emits a g_warning() if node did not contain the requested tag
- Gladeui.xml_get_value_string(node, name)¶
- Parameters:
node (
Gladeui.XmlNode) –name (
str) –
- Return type:
- Gladeui.xml_get_value_string_required(node, name, xtra_info)¶
- Parameters:
node (
Gladeui.XmlNode) –name (
str) –xtra_info (
str) –
- Return type:
- Gladeui.xml_load_sym_from_node(node_in, module, tagname, sym_location)¶
- Parameters:
node_in (
Gladeui.XmlNode) –module (
GModule.Module) –tagname (
str) –
- Return type:
- Gladeui.xml_search_child(node, name)¶
- Parameters:
node (
Gladeui.XmlNode) –name (
str) –
- Return type:
- Gladeui.xml_search_child_required(tree, name)¶
- Parameters:
tree (
Gladeui.XmlNode) – AGladeui.XmlNodename (
str) – the name of the child
- Returns:
the requested
Gladeui.XmlNode- Return type:
just a small wrapper around
Gladeui.xml_search_childthat displays an error if the child was not found
- Gladeui.xml_set_content(node_in, content)¶
- Parameters:
node_in (
Gladeui.XmlNode) – aGladeui.XmlNodecontent (
str) – a string
Sets the content of node to content.
- Gladeui.xml_set_value(node_in, name, val)¶
- Parameters:
node_in (
Gladeui.XmlNode) – aGladeui.XmlNodename (
str) – a stringval (
str) – a string
Sets the property name in node_in to val