RecentChooserDialogRef
public struct RecentChooserDialogRef : RecentChooserDialogProtocol, GWeakCapturing
GtkRecentChooserDialog is a dialog box suitable for displaying the recently
used documents. This widgets works by putting a GtkRecentChooserWidget inside
a GtkDialog. It exposes the GtkRecentChooserIface interface, so you can use
all the GtkRecentChooser functions on the recent chooser dialog as well as
those for GtkDialog.
Note that GtkRecentChooserDialog does not have any methods of its own.
Instead, you should use the functions that work on a GtkRecentChooser.
Typical usage ##
In the simplest of cases, you can use the following code to use
a GtkRecentChooserDialog to select a recently used file:
(C Language Example):
GtkWidget *dialog;
gint res;
dialog = gtk_recent_chooser_dialog_new ("Recent Documents",
parent_window,
_("_Cancel"),
GTK_RESPONSE_CANCEL,
_("_Open"),
GTK_RESPONSE_ACCEPT,
NULL);
res = gtk_dialog_run (GTK_DIALOG (dialog));
if (res == GTK_RESPONSE_ACCEPT)
{
GtkRecentInfo *info;
GtkRecentChooser *chooser = GTK_RECENT_CHOOSER (dialog);
info = gtk_recent_chooser_get_current_item (chooser);
open_file (gtk_recent_info_get_uri (info));
gtk_recent_info_unref (info);
}
gtk_widget_destroy (dialog);
Recently used files are supported since GTK+ 2.10.
The RecentChooserDialogRef type acts as a lightweight Swift reference to an underlying GtkRecentChooserDialog instance.
It exposes methods that can operate on this data type through RecentChooserDialogProtocol conformance.
Use RecentChooserDialogRef only as an unowned reference to an existing GtkRecentChooserDialog instance.
-
Untyped pointer to the underlying `GtkRecentChooserDialog` instance.For type-safe access, use the generated, typed pointer
recent_chooser_dialog_ptrproperty instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkRecentChooserDialog>) -
Designated initialiser from a constant pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkRecentChooserDialog>) -
Conditional initialiser from an optional pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkRecentChooserDialog>?) -
Conditional initialiser from an optional, non-mutable pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkRecentChooserDialog>?) -
Conditional initialiser from an optional
gpointerDeclaration
Swift
@inlinable init!(gpointer g: gpointer?) -
Conditional initialiser from an optional, non-mutable
gconstpointerDeclaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?) -
Reference intialiser for a related type that implements
RecentChooserDialogProtocolDeclaration
Swift
@inlinable init<T>(_ other: T) where T : RecentChooserDialogProtocol -
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> RecentChooserDialogRef where T : RecentChooserDialogProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
RecentChooserDialogProtocol.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
RecentChooserDialogProtocol.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
RecentChooserDialogProtocol.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
RecentChooserDialogProtocol.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
RecentChooserDialogProtocol.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
View on GitHub
Install in Dash
RecentChooserDialogRef Structure Reference