The functions and objects described here make working with GTK+ and GIO more convenient.
GtkMountOperation is needed when mounting volumes:
It is an implementation of GMountOperation that can be used with
GIO functions for mounting volumes such as
g_mount_unmount_with_operation() and others.
When necessary, GtkMountOperation shows dialogs to ask for passwords, questions or show processes blocking unmount.
gtk_show_uri_on_window() is a convenient way to launch applications for URIs.
Another object that is worth mentioning in this context is GdkAppLaunchContext, which provides visual feedback when lauching applications.
GMountOperation * gtk_mount_operation_new (
Creates a new GtkMountOperation
transient parent of the window, or
a new GtkMountOperation
gboolean gtk_mount_operation_is_showing (
Returns whether the GtkMountOperation is currently displaying a window.
is currently displaying a window
void gtk_mount_operation_set_parent (
Sets the transient parent for windows shown by the GtkMountOperation.
GtkWindow * gtk_mount_operation_get_parent (
Gets the transient parent used by the GtkMountOperation
void gtk_mount_operation_set_screen (
Sets the screen to show windows of the GtkMountOperation on.
GdkScreen * gtk_mount_operation_get_screen (
Gets the screen on which windows of the GtkMountOperation will be shown.
gtk_show_uri is deprecated and should not be used in newly-written code.
A convenience function for launching the default application
to show the uri. Like
gtk_show_uri_on_window(), but takes a screen
as transient parent instead of a window.
Note that this function is deprecated as it does not pass the necessary information for helpers to parent their dialog properly, when run from sandboxed applications for example.
gboolean gtk_show_uri_on_window (
const char *uri,
This is a convenience function for launching the default application to show the uri. The uri must be of a form understood by GIO (i.e. you need to install gvfs to get support for uri schemes such as http:// or ftp://, as only local files are handled by GIO itself). Typical examples are
This is the recommended call to be used as it passes information necessary for sandbox helpers to parent their dialogs properly.
the uri to show
a timestamp to prevent focus stealing
a GError that is returned in case of errors
Types and Values
This should not be accessed directly. Use the accessor functions below.
Are we showing a dialog.
Default value: FALSE
“parent” GtkWindow *
The parent window.
Flags: Read / Write
“screen” GdkScreen *
The screen where this window will be displayed.
Flags: Read / Write