CtkRecentChooserDialog

CtkRecentChooserDialog — Displays recently used files in a dialog

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkBin
                    ╰── CtkWindow
                        ╰── CtkDialog
                            ╰── CtkRecentChooserDialog

Implemented Interfaces

CtkRecentChooserDialog implements AtkImplementorIface, CtkBuildable and CtkRecentChooser.

Includes

#include <ctk/ctk.h>

Description

CtkRecentChooserDialog is a dialog box suitable for displaying the recently used documents. This widgets works by putting a CtkRecentChooserWidget inside a CtkDialog. It exposes the CtkRecentChooserIface interface, so you can use all the CtkRecentChooser functions on the recent chooser dialog as well as those for CtkDialog.

Note that CtkRecentChooserDialog does not have any methods of its own. Instead, you should use the functions that work on a CtkRecentChooser.

Typical usage

In the simplest of cases, you can use the following code to use a CtkRecentChooserDialog to select a recently used file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CtkWidget *dialog;
gint res;

dialog = ctk_recent_chooser_dialog_new ("Recent Documents",
                                        parent_window,
                                        _("_Cancel"),
                                        CTK_RESPONSE_CANCEL,
                                        _("_Open"),
                                        CTK_RESPONSE_ACCEPT,
                                        NULL);

res = ctk_dialog_run (CTK_DIALOG (dialog));
if (res == CTK_RESPONSE_ACCEPT)
  {
    CtkRecentInfo *info;
    CtkRecentChooser *chooser = CTK_RECENT_CHOOSER (dialog);

    info = ctk_recent_chooser_get_current_item (chooser);
    open_file (ctk_recent_info_get_uri (info));
    ctk_recent_info_unref (info);
  }

ctk_widget_destroy (dialog);

Recently used files are supported since CTK+ 2.10.

Functions

ctk_recent_chooser_dialog_new ()

CtkWidget *
ctk_recent_chooser_dialog_new (const gchar *title,
                               CtkWindow *parent,
                               const gchar *first_button_text,
                               ...);

Creates a new CtkRecentChooserDialog. This function is analogous to ctk_dialog_new_with_buttons().

Parameters

title

Title of the dialog, or NULL.

[allow-none]

parent

Transient parent of the dialog, or NULL,.

[allow-none]

first_button_text

stock ID or text to go in the first button, or NULL.

[allow-none]

...

response ID for the first button, then additional (button, id) pairs, ending with NULL

 

Returns

a new CtkRecentChooserDialog

Since: 2.10


ctk_recent_chooser_dialog_new_for_manager ()

CtkWidget *
ctk_recent_chooser_dialog_new_for_manager
                               (const gchar *title,
                                CtkWindow *parent,
                                CtkRecentManager *manager,
                                const gchar *first_button_text,
                                ...);

Creates a new CtkRecentChooserDialog with a specified recent manager.

This is useful if you have implemented your own recent manager, or if you have a customized instance of a CtkRecentManager object.

Parameters

title

Title of the dialog, or NULL.

[allow-none]

parent

Transient parent of the dialog, or NULL,.

[allow-none]

manager

a CtkRecentManager

 

first_button_text

stock ID or text to go in the first button, or NULL.

[allow-none]

...

response ID for the first button, then additional (button, id) pairs, ending with NULL

 

Returns

a new CtkRecentChooserDialog

Since: 2.10

Types and Values

struct CtkRecentChooserDialog

struct CtkRecentChooserDialog;

See Also

CtkRecentChooser, CtkDialog