FileIcon

Gnome::Gio::FileIcon

Icons pointing to an image file

Description

include: gio/gio.h

Gnome::Gio::FileIcon specifies an icon by pointing to an image file to be used as icon.

See Also

Gnome::Gio::Icon, Gnome::Gio::LoadableIcon

Synopsis

Declaration

unit class Gnome::Gio::FileIcon;
  also is Gnome::GObject::Object;
  also does Gnome::Gio::Icon;

Uml Diagram

![](plantuml/FileIcon.svg)

Methods

new

:file

Create a new FileIcon object.

multi method new ( N-GObject :$file! )

:string

Generate a Gnome::Gio::FileIcon instance from a string. This function can fail if the string is not valid - see Gnome::Gio::Icon.to-string() for discussion. When it fails, the error object in the attribute $.last-error will be set.

method new ( Str :$string! )
  • $string; A string obtained via Gnome::Gio::Icon.to-string().

:native-object

Create a FileIcon object using a native object from elsewhere. See also Gnome::N::TopLevelClassSupport.

multi method new ( N-GObject :$native-object! )

get-file

Gets the Gnome::Gio::File associated with the given icon.

Returns: a Gnome::Gio::File, or undefined.

method get-file ( --> N-GFile )

_g_file_icon_new

Creates a new icon for a file.

Returns: (type GFileIcon): a Gnome::Gio::Icon for the given file, or undefined on error.

method _g_file_icon_new ( N-GObject $file --> N-GObject )
  • $file; a Gnome::Gio::File.

Properties

An example of using a string type property of a Gnome::Gtk3::Label object. This is just showing how to set/read a property, not that it is the best way to do it. This is because a) The class initialization often provides some options to set some of the properties and b) the classes provide many methods to modify just those properties. In the case below one can use new(:label('my text label')) or .set-text('my text label').

my Gnome::Gtk3::Label $label .= new;
  my Gnome::GObject::Value $gv .= new(:init(G_TYPE_STRING));
  $label.get-property( 'label', $gv);
  $gv.set-string('my text label');

Supported properties

file: file

The file containing the icon.Widget type: G_TYPE_FILE

The Gnome::GObject::Value type of property file is G_TYPE_OBJECT.

Gnome::Gio v0.11.1

Raku Gnome GIO api, Please install Gnome::Gtk3

Authors

  • Marcel Timmerman

License

Artistic-2.0

Dependencies

Gnome::N:ap1<1>Gnome::Glib:ap1<1>Gnome::GObject:ap1<1>

Test Dependencies

Provides

  • Gnome::Gio::Action
  • Gnome::Gio::ActionGroup
  • Gnome::Gio::ActionMap
  • Gnome::Gio::AppInfo
  • Gnome::Gio::AppInfoMonitor
  • Gnome::Gio::AppLaunchContext
  • Gnome::Gio::Application
  • Gnome::Gio::ApplicationCommandLine
  • Gnome::Gio::DesktopAppInfo
  • Gnome::Gio::Emblem
  • Gnome::Gio::EmblemedIcon
  • Gnome::Gio::Enums
  • Gnome::Gio::File
  • Gnome::Gio::FileIcon
  • Gnome::Gio::Icon
  • Gnome::Gio::Menu
  • Gnome::Gio::MenuAttributeIter
  • Gnome::Gio::MenuItem
  • Gnome::Gio::MenuLinkIter
  • Gnome::Gio::MenuModel
  • Gnome::Gio::Notification
  • Gnome::Gio::Resource
  • Gnome::Gio::SimpleAction
  • Gnome::Gio::SimpleActionGroup
  • Gnome::Gio::ThemedIcon

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.