| Top |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBin
╰── CtkWindow
╰── CtkDialog
╰── CtkRecentChooserDialog
CtkRecentChooserDialog implements AtkImplementorIface, CtkBuildable and CtkRecentChooser.
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.
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.
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().
title |
Title of the dialog, or |
[allow-none] |
parent |
Transient parent of the dialog, or |
[allow-none] |
first_button_text |
stock ID or text to go in the first button, or |
[allow-none] |
... |
response ID for the first button, then additional (button, id)
pairs, ending with |
Since: 2.10
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.
title |
Title of the dialog, or |
[allow-none] |
parent |
Transient parent of the dialog, or |
[allow-none] |
manager |
||
first_button_text |
stock ID or text to go in the first button, or |
[allow-none] |
... |
response ID for the first button, then additional (button, id)
pairs, ending with |
Since: 2.10