GimpUi.PageSelector

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GimpUi.PageSelector GimpUi.PageSelector Gtk.Box Gtk.Box Gtk.Box->GimpUi.PageSelector Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

get_n_pages ()

get_page_label (page_no)

get_page_thumbnail (page_no)

get_selected_pages ()

get_selected_range ()

get_target ()

page_is_selected (page_no)

select_all ()

select_page (page_no)

select_range (range)

set_n_pages (n_pages)

set_page_label (page_no, label)

set_page_thumbnail (page_no, thumbnail)

set_target (target)

unselect_all ()

unselect_page (page_no)

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited:

Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

n-pages

int

r/w

The number of pages to open

target

GimpUi.PageSelectorTarget

r/w

the target to open to

Child Properties

Inherited:

Gtk.Box (5)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Short Description

activate

The “activate” signal on GimpUi.PageSelector is an action signal.

selection-changed

This signal is emitted whenever the set of selected pages changes.

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class GimpUi.PageSelector(*args, **kwargs)
Bases:

Gtk.Box

Abstract:

No

Structure:

GimpUi.PageSelectorClass

Use this for example for specifying what pages to import from a PDF or PS document.

classmethod new()
Returns:

Pointer to the new GimpUi.PageSelector widget.

Return type:

Gtk.Widget

Creates a new GimpUi.PageSelector widget.

New in version 2.4.

get_n_pages()
Returns:

the number of pages in the document to open.

Return type:

int

New in version 2.4.

get_page_label(page_no)
Parameters:

page_no (int) – The number of the page to get the thumbnail for.

Returns:

The page’s label, or None if none is set. This is a newly allocated string that should be GLib.free()’d when no longer needed.

Return type:

str or None

New in version 2.4.

get_page_thumbnail(page_no)
Parameters:

page_no (int) – The number of the page to get the thumbnail for.

Returns:

The page’s thumbnail, or None if none is set. The returned pixbuf is owned by GimpUi.PageSelector and must not be unref’ed when no longer needed.

Return type:

GdkPixbuf.Pixbuf or None

New in version 2.4.

get_selected_pages()
Returns:

A sorted array of page numbers of selected pages. Use GLib.free() if you don’t need the array any longer

Return type:

[int]

New in version 2.4.

get_selected_range()
Returns:

A newly allocated string representing the set of selected pages. See GimpUi.PageSelector.select_range() for the format of the string.

Return type:

str

New in version 2.4.

get_target()
Returns:

How the selected pages should be opened.

Return type:

GimpUi.PageSelectorTarget

New in version 2.4.

page_is_selected(page_no)
Parameters:

page_no (int) – The number of the page to check.

Returns:

True if the page is selected, False otherwise.

Return type:

bool

New in version 2.4.

select_all()

Selects all pages.

New in version 2.4.

select_page(page_no)
Parameters:

page_no (int) – The number of the page to select.

Adds a page to the selection.

New in version 2.4.

select_range(range)
Parameters:

range (str) – A string representing the set of selected pages.

Selects the pages described by range. The range string is a user-editable list of pages and ranges, e.g. “1,3,5-7,9-12,14”. Note that the page numbering in the range string starts with 1, not 0.

Invalid pages and ranges will be silently ignored, duplicate and overlapping pages and ranges will be merged.

New in version 2.4.

set_n_pages(n_pages)
Parameters:

n_pages (int) – The number of pages.

Sets the number of pages in the document to open.

New in version 2.4.

set_page_label(page_no, label)
Parameters:
  • page_no (int) – The number of the page to set the label for.

  • label (str) – The label.

Sets the label of the specified page.

New in version 2.4.

set_page_thumbnail(page_no, thumbnail)
Parameters:
  • page_no (int) – The number of the page to set the thumbnail for.

  • thumbnail (GdkPixbuf.Pixbuf) – The thumbnail pixbuf.

Sets the thumbnail for given page_no. A default “page” icon will be used if no page thumbnail is set.

New in version 2.4.

set_target(target)
Parameters:

target (GimpUi.PageSelectorTarget) – How to open the selected pages.

New in version 2.4.

unselect_all()

Unselects all pages.

New in version 2.4.

unselect_page(page_no)
Parameters:

page_no (int) – The number of the page to unselect.

Removes a page from the selection.

New in version 2.4.

Signal Details

GimpUi.PageSelector.signals.activate(page_selector)
Signal Name:

activate

Flags:

RUN_FIRST, ACTION

Parameters:

page_selector (GimpUi.PageSelector) – The object which received the signal

The “activate” signal on GimpUi.PageSelector is an action signal. It is emitted when a user double-clicks an item in the page selection.

New in version 2.4.

GimpUi.PageSelector.signals.selection_changed(page_selector)
Signal Name:

selection-changed

Flags:

RUN_FIRST

Parameters:

page_selector (GimpUi.PageSelector) – The object which received the signal

This signal is emitted whenever the set of selected pages changes.

New in version 2.4.

Property Details

GimpUi.PageSelector.props.n_pages
Name:

n-pages

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The number of pages of the document to open.

New in version 2.4.

GimpUi.PageSelector.props.target
Name:

target

Type:

GimpUi.PageSelectorTarget

Default Value:

GimpUi.PageSelectorTarget.LAYERS

Flags:

READABLE, WRITABLE

The target to open the document to.

New in version 2.4.