Gdl.DockLayout

g GObject.Object GObject.Object Gdl.DockLayout Gdl.DockLayout GObject.Object->Gdl.DockLayout

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (master)

attach (master)

delete_layout (name)

get_layouts (include_default)

get_master ()

is_dirty ()

load_from_file (filename)

load_layout (name)

save_layout (name)

save_to_file (filename)

set_master (master)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

dirty

bool

r

True if the layouts have changed and need to be saved to a file

master

GObject.Object

r/w

Gdl.DockMaster or Gdl.DockObject object which the layout object is attached to

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

deprecated_dirty

bool

r

deprecated_master

Gdl.DockMaster

r

g_object

GObject.Object

r

Class Details

class Gdl.DockLayout(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gdl.DockLayoutClass

The Gdl.DockLayout struct contains only private fields and should not be directly accessed.

classmethod new(master)
Parameters:

master (GObject.Object) – A master or a dock object to which the layout will be attached.

Returns:

New Gdl.DockLayout item.

Return type:

Gdl.DockLayout

Creates a new Gdl.DockLayout. Instead of setting master directly with a master object, it is possible to use a Gdl.DockObject, in this case the layout will be attached to the same master than the dock object.

attach(master)
Parameters:

master (Gdl.DockMaster) – The master object to which the layout will be attached

Attach the self to the master and delete the reference to the master that the layout attached previously.

Deprecated 3.6: Use Gdl.DockLayout.set_master() instead.

delete_layout(name)
Parameters:

name (str) – The name of the layout to delete.

Deletes the layout with the given name from the memory. This will set Gdl.DockLayout :dirty to True.

get_layouts(include_default)
Parameters:

include_default (bool) – True to include the default layout.

Returns:

a GLib.List list holding the layout names. You must first free each element in the list with GLib.free(), then free the list itself with g_list_free().

Return type:

[str]

Get the list of layout names including or not the default layout.

get_master()
Returns:

a Gdl.DockMaster object

Return type:

GObject.Object

Retrieves the master of the object.

New in version 3.6.

is_dirty()
Returns:

True is the layout in the memory is different from the file, else False.

Return type:

bool

Checks whether the XML tree in memory is different from the file where the layout was saved.

load_from_file(filename)
Parameters:

filename (str) – The name of the file to load.

Returns:

True if self successfully loaded else False

Return type:

bool

Loads the layout from file with the given filename. This will set Gdl.DockLayout :dirty to False.

load_layout(name)
Parameters:

name (str or None) – The name of the layout to load or None for a default layout name.

Returns:

True if layout successfully loaded else False

Return type:

bool

Loads the layout with the given name from the memory. This will set Gdl.DockLayout :dirty to True.

See also Gdl.DockLayout.load_from_file()

save_layout(name)
Parameters:

name (str or None) – The name of the layout to save or None for a default layout name.

Saves the self with the given name to the memory. This will set Gdl.DockLayout :dirty to True.

See also Gdl.DockLayout.save_to_file().

save_to_file(filename)
Parameters:

filename (str) – Name of the file we want to save in layout

Returns:

True if self successfuly save to the file, otherwise False.

Return type:

bool

This function saves the current layout in XML format to the file with the given filename.

set_master(master)
Parameters:

master (GObject.Object) – The master object to which the layout will be attached

Attach the self to the master and delete the reference to the master that the layout attached previously. Instead of setting master directly with the master object, it is possible to use a Gdl.DockObject, in this case the layout will be attached to the same master than the dock object.

Property Details

Gdl.DockLayout.props.dirty
Name:

dirty

Type:

bool

Default Value:

False

Flags:

READABLE

True if the layouts have changed and need to be saved to a file

Gdl.DockLayout.props.master
Name:

master

Type:

GObject.Object

Default Value:

None

Flags:

READABLE, WRITABLE

Gdl.DockMaster or Gdl.DockObject object which the layout object is attached to