Index

Package: Image

Description

package Gtk.Image is

The Gtk.Image.Gtk_Image widget displays an image. Various kinds of object can be displayed as an image; most typically, you would load a Gdk.Pixbuf.Gdk_Pixbuf ("pixel buffer") from a file, and then display that.

There's a convenience function to do this, Gtk.Image.Gtk_New, used as follows: GtkWidget *image; image = gtk_image_new_from_file ("myfile.png"); If the file isn't loaded successfully, the image will contain a "broken image" icon similar to that used in many web browsers. If you want to handle errors in loading the file yourself, for example by displaying an error message, then load the image with Gdk.Pixbuf.Gdk_New_From_File, then create the Gtk.Image.Gtk_Image with Gtk.Image.Gtk_New.

The image file may contain an animation, if so the Gtk.Image.Gtk_Image will display an animation (Gdk_Pixbuf_Animation) instead of a static image.

Gtk.Image.Gtk_Image is a subclass of Gtk.Misc.Gtk_Misc, which implies that you can align it (center, left, right) and add padding to it, using Gtk.Misc.Gtk_Misc methods.

Gtk.Image.Gtk_Image is a "no window" widget (has no Gdk.Gdk_Window of its own), so by default does not receive events. If you want to receive events on the image, such as button clicks, place the image inside a Gtk.Event_Box.Gtk_Event_Box, then connect to the event signals on the event box. <title>Handling button press events on a <structname>GtkImage</structname>.</title> static gboolean button_press_callback (GtkWidget *event_box, GdkEventButton *event, gpointer data) { g_print ("Event box clicked at coordinates %f,%f\n", event->x, event->y); /<!---->* Returning TRUE means we handled the event, so the signal * emission should be stopped (don't call any further * callbacks that may be connected). Return FALSE * to continue invoking callbacks. *<!---->/ return TRUE; } static GtkWidget* create_image (void) { GtkWidget *image; GtkWidget *event_box; image = gtk_image_new_from_file ("myfile.png"); event_box = gtk_event_box_new (<!-- -->); gtk_container_add (GTK_CONTAINER (event_box), image); g_signal_connect (G_OBJECT (event_box), "button_press_event", G_CALLBACK (button_press_callback), image); return image; } When handling events on the event box, keep in mind that coordinates in the image may be different from event box coordinates due to the alignment and padding settings on the image (see Gtk.Misc.Gtk_Misc). The simplest way to solve this is to set the alignment to 0.0 (left/top), and set the padding to zero. Then the origin of the image will be the same as the origin of the event box.

Sometimes an application will want to avoid depending on external data files, such as image files. GTK+ comes with a program to avoid this, called <application>gdk-pixbuf-csource</application>. This library allows you to convert an image into a C variable declaration, which can then be loaded into a Gdk.Pixbuf.Gdk_Pixbuf using gdk_pixbuf_new_from_inline.

Screenshot

gtk-image.png

Packages

Gtk_Image_Type_Properties (new Glib.Generic_Properties.Generic_Internal_Discrete_Property)

package Gtk_Image_Type_Properties is
      new Generic_Internal_Discrete_Property (Gtk_Image_Type);

Implements_Gtk_Buildable (new Glib.Types.Implements)

Classes

Gtk_Image_Record

type Gtk_Image_Record is new Gtk_Misc_Record with null record;

Ancestors:

Primitive operations:

Get_Icon_Name
Get_Pixel_Size
Get_Storage_Type
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Gtk.Misc.Get_Alignment (Inherited)
Gtk.Misc.Get_Padding (Inherited)
Gtk.Misc.Set_Alignment (Inherited)
Gtk.Misc.Set_Padding (Inherited)
Gtk.Widget.Activate (Inherited)
Gtk.Widget.Add_Accelerator (Inherited)
Gtk.Widget.Add_Device_Events (Inherited)
Gtk.Widget.Add_Events (Inherited)
Gtk.Widget.Add_Mnemonic_Label (Inherited)
Gtk.Widget.Add_Tick_Callback (Inherited)
Gtk.Widget.Can_Activate_Accel (Inherited)
Gtk.Widget.Child_Focus (Inherited)
Gtk.Widget.Child_Notify (Inherited)
Gtk.Widget.Compute_Expand (Inherited)
Gtk.Widget.Create_Pango_Context (Inherited)
Gtk.Widget.Create_Pango_Layout (Inherited)
Gtk.Widget.Destroy (Inherited)
Gtk.Widget.Destroyed (Inherited)
Gtk.Widget.Device_Is_Shadowed (Inherited)
Gtk.Widget.Drag_Check_Threshold (Inherited)
Gtk.Widget.Drag_Dest_Add_Image_Targets (Inherited)
Gtk.Widget.Drag_Dest_Add_Text_Targets (Inherited)
Gtk.Widget.Drag_Dest_Add_Uri_Targets (Inherited)
Gtk.Widget.Drag_Dest_Get_Track_Motion (Inherited)
Gtk.Widget.Drag_Dest_Set_Proxy (Inherited)
Gtk.Widget.Drag_Dest_Set_Track_Motion (Inherited)
Gtk.Widget.Drag_Dest_Unset (Inherited)
Gtk.Widget.Drag_Get_Data (Inherited)
Gtk.Widget.Drag_Highlight (Inherited)
Gtk.Widget.Drag_Source_Add_Image_Targets (Inherited)
Gtk.Widget.Drag_Source_Add_Uri_Targets (Inherited)
Gtk.Widget.Drag_Source_Set_Icon_Pixbuf (Inherited)
Gtk.Widget.Drag_Source_Unset (Inherited)
Gtk.Widget.Drag_Unhighlight (Inherited)
Gtk.Widget.Draw (Inherited)
Gtk.Widget.Ensure_Style (Inherited)
Gtk.Widget.Error_Bell (Inherited)
Gtk.Widget.Event (Inherited)
Gtk.Widget.Freeze_Child_Notify (Inherited)
Gtk.Widget.Get_Allocated_Height (Inherited)
Gtk.Widget.Get_Allocated_Width (Inherited)
Gtk.Widget.Get_Allocation (Inherited)
Gtk.Widget.Get_Ancestor (Inherited)
Gtk.Widget.Get_App_Paintable (Inherited)
Gtk.Widget.Get_Can_Default (Inherited)
Gtk.Widget.Get_Can_Focus (Inherited)
Gtk.Widget.Get_Child_Requisition (Inherited)
Gtk.Widget.Get_Child_Visible (Inherited)
Gtk.Widget.Get_Composite_Name (Inherited)
Gtk.Widget.Get_Device_Enabled (Inherited)
Gtk.Widget.Get_Device_Events (Inherited)
Gtk.Widget.Get_Direction (Inherited)
Gtk.Widget.Get_Display (Inherited)
Gtk.Widget.Get_Double_Buffered (Inherited)
Gtk.Widget.Get_Events (Inherited)
Gtk.Widget.Get_Frame_Clock (Inherited)
Gtk.Widget.Get_Halign (Inherited)
Gtk.Widget.Get_Has_Tooltip (Inherited)
Gtk.Widget.Get_Has_Window (Inherited)
Gtk.Widget.Get_Hexpand (Inherited)
Gtk.Widget.Get_Hexpand_Set (Inherited)
Gtk.Widget.Get_Mapped (Inherited)
Gtk.Widget.Get_Margin_Bottom (Inherited)
Gtk.Widget.Get_Margin_Left (Inherited)
Gtk.Widget.Get_Margin_Right (Inherited)
Gtk.Widget.Get_Margin_Top (Inherited)
Gtk.Widget.Get_Modifier_Mask (Inherited)
Gtk.Widget.Get_Name (Inherited)
Gtk.Widget.Get_No_Show_All (Inherited)
Gtk.Widget.Get_Opacity (Inherited)
Gtk.Widget.Get_Pango_Context (Inherited)
Gtk.Widget.Get_Parent (Inherited)
Gtk.Widget.Get_Parent_Window (Inherited)
Gtk.Widget.Get_Path (Inherited)
Gtk.Widget.Get_Pointer (Inherited)
Gtk.Widget.Get_Preferred_Height (Inherited)
Gtk.Widget.Get_Preferred_Height_For_Width (Inherited)
Gtk.Widget.Get_Preferred_Size (Inherited)
Gtk.Widget.Get_Preferred_Width (Inherited)
Gtk.Widget.Get_Preferred_Width_For_Height (Inherited)
Gtk.Widget.Get_Realized (Inherited)
Gtk.Widget.Get_Receives_Default (Inherited)
Gtk.Widget.Get_Request_Mode (Inherited)
Gtk.Widget.Get_Requisition (Inherited)
Gtk.Widget.Get_Root_Window (Inherited)
Gtk.Widget.Get_Screen (Inherited)
Gtk.Widget.Get_Sensitive (Inherited)
Gtk.Widget.Get_Size_Request (Inherited)
Gtk.Widget.Get_State (Inherited)
Gtk.Widget.Get_State_Flags (Inherited)
Gtk.Widget.Get_Style (Inherited)
Gtk.Widget.Get_Support_Multidevice (Inherited)
Gtk.Widget.Get_Tooltip_Markup (Inherited)
Gtk.Widget.Get_Tooltip_Text (Inherited)
Gtk.Widget.Get_Tooltip_Window (Inherited)
Gtk.Widget.Get_Toplevel (Inherited)
Gtk.Widget.Get_Valign (Inherited)
Gtk.Widget.Get_Vexpand (Inherited)
Gtk.Widget.Get_Vexpand_Set (Inherited)
Gtk.Widget.Get_Visible (Inherited)
Gtk.Widget.Get_Visual (Inherited)
Gtk.Widget.Get_Window (Inherited)
Gtk.Widget.Grab_Add (Inherited)
Gtk.Widget.Grab_Default (Inherited)
Gtk.Widget.Grab_Focus (Inherited)
Gtk.Widget.Grab_Remove (Inherited)
Gtk.Widget.Has_Default (Inherited)
Gtk.Widget.Has_Focus (Inherited)
Gtk.Widget.Has_Grab (Inherited)
Gtk.Widget.Has_Rc_Style (Inherited)
Gtk.Widget.Has_Screen (Inherited)
Gtk.Widget.Has_Visible_Focus (Inherited)
Gtk.Widget.Hide (Inherited)
Gtk.Widget.Hide_On_Delete (Inherited)
Gtk.Widget.In_Destruction (Inherited)
Gtk.Widget.Input_Shape_Combine_Region (Inherited)
Gtk.Widget.Intersect (Inherited)
Gtk.Widget.Is_Ancestor (Inherited)
Gtk.Widget.Is_Composited (Inherited)
Gtk.Widget.Is_Drawable (Inherited)
Gtk.Widget.Is_Focus (Inherited)
Gtk.Widget.Is_Sensitive (Inherited)
Gtk.Widget.Is_Toplevel (Inherited)
Gtk.Widget.Is_Visible (Inherited)
Gtk.Widget.Keynav_Failed (Inherited)
Gtk.Widget.List_Mnemonic_Labels (Inherited)
Gtk.Widget.Map (Inherited)
Gtk.Widget.Mnemonic_Activate (Inherited)
Gtk.Widget.Modify_Base (Inherited)
Gtk.Widget.Modify_Bg (Inherited)
Gtk.Widget.Modify_Cursor (Inherited)
Gtk.Widget.Modify_Fg (Inherited)
Gtk.Widget.Modify_Font (Inherited)
Gtk.Widget.Modify_Text (Inherited)
Gtk.Widget.On_Accel_Closures_Changed (Inherited)
Gtk.Widget.On_Accel_Closures_Changed (Inherited)
Gtk.Widget.On_Button_Press_Event (Inherited)
Gtk.Widget.On_Button_Press_Event (Inherited)
Gtk.Widget.On_Button_Release_Event (Inherited)
Gtk.Widget.On_Button_Release_Event (Inherited)
Gtk.Widget.On_Can_Activate_Accel (Inherited)
Gtk.Widget.On_Can_Activate_Accel (Inherited)
Gtk.Widget.On_Child_Notify (Inherited)
Gtk.Widget.On_Child_Notify (Inherited)
Gtk.Widget.On_Composited_Changed (Inherited)
Gtk.Widget.On_Composited_Changed (Inherited)
Gtk.Widget.On_Configure_Event (Inherited)
Gtk.Widget.On_Configure_Event (Inherited)
Gtk.Widget.On_Damage_Event (Inherited)
Gtk.Widget.On_Damage_Event (Inherited)
Gtk.Widget.On_Delete_Event (Inherited)
Gtk.Widget.On_Delete_Event (Inherited)
Gtk.Widget.On_Destroy (Inherited)
Gtk.Widget.On_Destroy (Inherited)
Gtk.Widget.On_Destroy_Event (Inherited)
Gtk.Widget.On_Destroy_Event (Inherited)
Gtk.Widget.On_Direction_Changed (Inherited)
Gtk.Widget.On_Direction_Changed (Inherited)
Gtk.Widget.On_Drag_Begin (Inherited)
Gtk.Widget.On_Drag_Begin (Inherited)
Gtk.Widget.On_Drag_Data_Delete (Inherited)
Gtk.Widget.On_Drag_Data_Delete (Inherited)
Gtk.Widget.On_Drag_Data_Get (Inherited)
Gtk.Widget.On_Drag_Data_Get (Inherited)
Gtk.Widget.On_Drag_Data_Received (Inherited)
Gtk.Widget.On_Drag_Data_Received (Inherited)
Gtk.Widget.On_Drag_Drop (Inherited)
Gtk.Widget.On_Drag_Drop (Inherited)
Gtk.Widget.On_Drag_End (Inherited)
Gtk.Widget.On_Drag_End (Inherited)
Gtk.Widget.On_Drag_Failed (Inherited)
Gtk.Widget.On_Drag_Failed (Inherited)
Gtk.Widget.On_Drag_Leave (Inherited)
Gtk.Widget.On_Drag_Leave (Inherited)
Gtk.Widget.On_Drag_Motion (Inherited)
Gtk.Widget.On_Drag_Motion (Inherited)
Gtk.Widget.On_Draw (Inherited)
Gtk.Widget.On_Draw (Inherited)
Gtk.Widget.On_Enter_Notify_Event (Inherited)
Gtk.Widget.On_Enter_Notify_Event (Inherited)
Gtk.Widget.On_Event (Inherited)
Gtk.Widget.On_Event (Inherited)
Gtk.Widget.On_Event_After (Inherited)
Gtk.Widget.On_Event_After (Inherited)
Gtk.Widget.On_Focus (Inherited)
Gtk.Widget.On_Focus (Inherited)
Gtk.Widget.On_Focus_In_Event (Inherited)
Gtk.Widget.On_Focus_In_Event (Inherited)
Gtk.Widget.On_Focus_Out_Event (Inherited)
Gtk.Widget.On_Focus_Out_Event (Inherited)
Gtk.Widget.On_Grab_Broken_Event (Inherited)
Gtk.Widget.On_Grab_Broken_Event (Inherited)
Gtk.Widget.On_Grab_Focus (Inherited)
Gtk.Widget.On_Grab_Focus (Inherited)
Gtk.Widget.On_Grab_Notify (Inherited)
Gtk.Widget.On_Grab_Notify (Inherited)
Gtk.Widget.On_Hide (Inherited)
Gtk.Widget.On_Hide (Inherited)
Gtk.Widget.On_Hierarchy_Changed (Inherited)
Gtk.Widget.On_Hierarchy_Changed (Inherited)
Gtk.Widget.On_Key_Press_Event (Inherited)
Gtk.Widget.On_Key_Press_Event (Inherited)
Gtk.Widget.On_Key_Release_Event (Inherited)
Gtk.Widget.On_Key_Release_Event (Inherited)
Gtk.Widget.On_Keynav_Failed (Inherited)
Gtk.Widget.On_Keynav_Failed (Inherited)
Gtk.Widget.On_Leave_Notify_Event (Inherited)
Gtk.Widget.On_Leave_Notify_Event (Inherited)
Gtk.Widget.On_Map (Inherited)
Gtk.Widget.On_Map (Inherited)
Gtk.Widget.On_Map_Event (Inherited)
Gtk.Widget.On_Map_Event (Inherited)
Gtk.Widget.On_Mnemonic_Activate (Inherited)
Gtk.Widget.On_Mnemonic_Activate (Inherited)
Gtk.Widget.On_Motion_Notify_Event (Inherited)
Gtk.Widget.On_Motion_Notify_Event (Inherited)
Gtk.Widget.On_Move_Focus (Inherited)
Gtk.Widget.On_Move_Focus (Inherited)
Gtk.Widget.On_Parent_Set (Inherited)
Gtk.Widget.On_Parent_Set (Inherited)
Gtk.Widget.On_Popup_Menu (Inherited)
Gtk.Widget.On_Popup_Menu (Inherited)
Gtk.Widget.On_Property_Notify_Event (Inherited)
Gtk.Widget.On_Property_Notify_Event (Inherited)
Gtk.Widget.On_Proximity_In_Event (Inherited)
Gtk.Widget.On_Proximity_In_Event (Inherited)
Gtk.Widget.On_Proximity_Out_Event (Inherited)
Gtk.Widget.On_Proximity_Out_Event (Inherited)
Gtk.Widget.On_Query_Tooltip (Inherited)
Gtk.Widget.On_Query_Tooltip (Inherited)
Gtk.Widget.On_Realize (Inherited)
Gtk.Widget.On_Realize (Inherited)
Gtk.Widget.On_Screen_Changed (Inherited)
Gtk.Widget.On_Screen_Changed (Inherited)
Gtk.Widget.On_Scroll_Event (Inherited)
Gtk.Widget.On_Scroll_Event (Inherited)
Gtk.Widget.On_Selection_Clear_Event (Inherited)
Gtk.Widget.On_Selection_Clear_Event (Inherited)
Gtk.Widget.On_Selection_Get (Inherited)
Gtk.Widget.On_Selection_Get (Inherited)
Gtk.Widget.On_Selection_Notify_Event (Inherited)
Gtk.Widget.On_Selection_Notify_Event (Inherited)
Gtk.Widget.On_Selection_Received (Inherited)
Gtk.Widget.On_Selection_Received (Inherited)
Gtk.Widget.On_Selection_Request_Event (Inherited)
Gtk.Widget.On_Selection_Request_Event (Inherited)
Gtk.Widget.On_Show (Inherited)
Gtk.Widget.On_Show (Inherited)
Gtk.Widget.On_Show_Help (Inherited)
Gtk.Widget.On_Show_Help (Inherited)
Gtk.Widget.On_Size_Allocate (Inherited)
Gtk.Widget.On_Size_Allocate (Inherited)
Gtk.Widget.On_State_Changed (Inherited)
Gtk.Widget.On_State_Changed (Inherited)
Gtk.Widget.On_State_Flags_Changed (Inherited)
Gtk.Widget.On_State_Flags_Changed (Inherited)
Gtk.Widget.On_Style_Set (Inherited)
Gtk.Widget.On_Style_Set (Inherited)
Gtk.Widget.On_Style_Updated (Inherited)
Gtk.Widget.On_Style_Updated (Inherited)
Gtk.Widget.On_Touch_Event (Inherited)
Gtk.Widget.On_Touch_Event (Inherited)
Gtk.Widget.On_Unmap (Inherited)
Gtk.Widget.On_Unmap (Inherited)
Gtk.Widget.On_Unmap_Event (Inherited)
Gtk.Widget.On_Unmap_Event (Inherited)
Gtk.Widget.On_Unrealize (Inherited)
Gtk.Widget.On_Unrealize (Inherited)
Gtk.Widget.On_Visibility_Notify_Event (Inherited)
Gtk.Widget.On_Visibility_Notify_Event (Inherited)
Gtk.Widget.On_Window_State_Event (Inherited)
Gtk.Widget.On_Window_State_Event (Inherited)
Gtk.Widget.Override_Background_Color (Inherited)
Gtk.Widget.Override_Color (Inherited)
Gtk.Widget.Override_Cursor (Inherited)
Gtk.Widget.Override_Font (Inherited)
Gtk.Widget.Override_Symbolic_Color (Inherited)
Gtk.Widget.Queue_Compute_Expand (Inherited)
Gtk.Widget.Queue_Draw (Inherited)
Gtk.Widget.Queue_Draw_Area (Inherited)
Gtk.Widget.Queue_Draw_Region (Inherited)
Gtk.Widget.Queue_Resize (Inherited)
Gtk.Widget.Queue_Resize_No_Redraw (Inherited)
Gtk.Widget.Realize (Inherited)
Gtk.Widget.Region_Intersect (Inherited)
Gtk.Widget.Register_Window (Inherited)
Gtk.Widget.Remove_Accelerator (Inherited)
Gtk.Widget.Remove_Mnemonic_Label (Inherited)
Gtk.Widget.Remove_Tick_Callback (Inherited)
Gtk.Widget.Render_Icon (Inherited)
Gtk.Widget.Render_Icon_Pixbuf (Inherited)
Gtk.Widget.Reparent (Inherited)
Gtk.Widget.Reset_Rc_Styles (Inherited)
Gtk.Widget.Reset_Style (Inherited)
Gtk.Widget.Send_Expose (Inherited)
Gtk.Widget.Send_Focus_Change (Inherited)
Gtk.Widget.Set_Accel_Path (Inherited)
Gtk.Widget.Set_Allocation (Inherited)
Gtk.Widget.Set_App_Paintable (Inherited)
Gtk.Widget.Set_Can_Default (Inherited)
Gtk.Widget.Set_Can_Focus (Inherited)
Gtk.Widget.Set_Child_Visible (Inherited)
Gtk.Widget.Set_Composite_Name (Inherited)
Gtk.Widget.Set_Device_Enabled (Inherited)
Gtk.Widget.Set_Device_Events (Inherited)
Gtk.Widget.Set_Direction (Inherited)
Gtk.Widget.Set_Double_Buffered (Inherited)
Gtk.Widget.Set_Events (Inherited)
Gtk.Widget.Set_Halign (Inherited)
Gtk.Widget.Set_Has_Tooltip (Inherited)
Gtk.Widget.Set_Has_Window (Inherited)
Gtk.Widget.Set_Hexpand (Inherited)
Gtk.Widget.Set_Hexpand_Set (Inherited)
Gtk.Widget.Set_Mapped (Inherited)
Gtk.Widget.Set_Margin_Bottom (Inherited)
Gtk.Widget.Set_Margin_Left (Inherited)
Gtk.Widget.Set_Margin_Right (Inherited)
Gtk.Widget.Set_Margin_Top (Inherited)
Gtk.Widget.Set_Name (Inherited)
Gtk.Widget.Set_No_Show_All (Inherited)
Gtk.Widget.Set_Opacity (Inherited)
Gtk.Widget.Set_Parent (Inherited)
Gtk.Widget.Set_Parent_Window (Inherited)
Gtk.Widget.Set_Realized (Inherited)
Gtk.Widget.Set_Receives_Default (Inherited)
Gtk.Widget.Set_Redraw_On_Allocate (Inherited)
Gtk.Widget.Set_Sensitive (Inherited)
Gtk.Widget.Set_Size_Request (Inherited)
Gtk.Widget.Set_State (Inherited)
Gtk.Widget.Set_State_Flags (Inherited)
Gtk.Widget.Set_Style (Inherited)
Gtk.Widget.Set_Support_Multidevice (Inherited)
Gtk.Widget.Set_Tooltip_Markup (Inherited)
Gtk.Widget.Set_Tooltip_Text (Inherited)
Gtk.Widget.Set_Tooltip_Window (Inherited)
Gtk.Widget.Set_Valign (Inherited)
Gtk.Widget.Set_Vexpand (Inherited)
Gtk.Widget.Set_Vexpand_Set (Inherited)
Gtk.Widget.Set_Visible (Inherited)
Gtk.Widget.Set_Visual (Inherited)
Gtk.Widget.Set_Window (Inherited)
Gtk.Widget.Shape_Combine_Region (Inherited)
Gtk.Widget.Show (Inherited)
Gtk.Widget.Show_All (Inherited)
Gtk.Widget.Show_Now (Inherited)
Gtk.Widget.Size_Allocate (Inherited)
Gtk.Widget.Size_Request (Inherited)
Gtk.Widget.Style_Attach (Inherited)
Gtk.Widget.Style_Get_Property (Inherited)
Gtk.Widget.Thaw_Child_Notify (Inherited)
Gtk.Widget.Translate_Coordinates (Inherited)
Gtk.Widget.Trigger_Tooltip_Query (Inherited)
Gtk.Widget.Unmap (Inherited)
Gtk.Widget.Unparent (Inherited)
Gtk.Widget.Unrealize (Inherited)
Gtk.Widget.Unregister_Window (Inherited)
Gtk.Widget.Unset_State_Flags (Inherited)
Set_From_Icon_Name
Set_From_Resource
Set_Pixel_Size

Types

Gtk_Image

type Gtk_Image is access all Gtk_Image_Record'Class;

Gtk_Image_Type

type Gtk_Image_Type is (
      Image_Empty,
      Image_Pixbuf,
      Image_Stock,
      Image_Icon_Set,
      Image_Animation,
      Image_Icon_Name,
      Image_Gicon);

Property_Gtk_Image_Type

type Property_Gtk_Image_Type is new Gtk_Image_Type_Properties.Property;

Constants & Global variables

G_Icon_Property (Glib.Properties.Property_Boxed)

G_Icon_Property : constant Glib.Properties.Property_Boxed;
Type: Glib.G_Icon.G_Icon The GIcon displayed in the GtkImage. For themed icons, If the icon theme is changed, the image will be updated automatically.

Icon_Name_Property (Glib.Properties.Property_String)

Icon_Name_Property : constant Glib.Properties.Property_String;
The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically.

Icon_Size_Property (Glib.Properties.Property_Int)

Icon_Size_Property : constant Glib.Properties.Property_Int;

Pixel_Size_Property (Glib.Properties.Property_Int)

Pixel_Size_Property : constant Glib.Properties.Property_Int;
The "pixel-size" property can be used to specify a fixed size overriding the Gtk.Image.Gtk_Image:icon-size property for images of type Gtk.Image.Image_Icon_Name.

Resource_Property (Glib.Properties.Property_String)

Resource_Property : constant Glib.Properties.Property_String;
A path to a resource file to display.

Storage_Type_Property (Property_Gtk_Image_Type)

Storage_Type_Property : constant Gtk.Image.Property_Gtk_Image_Type;

Use_Fallback_Property (Glib.Properties.Property_Boolean)

Use_Fallback_Property : constant Glib.Properties.Property_Boolean;
Whether the icon displayed in the GtkImage will use standard icon names fallback. The value of this property is only relevant for images of type Gtk.Image.Image_Icon_Name and Gtk.Image.Image_Gicon.

Subprograms & Entries

Gtk_New

procedure Gtk_New 
(Image: out Gtk_Image);

Initialize

procedure Initialize 
(Image: not null access Gtk_Image_Record'Class);
Creates a new empty Gtk.Image.Gtk_Image widget.

Gtk_Image_New

function Gtk_Image_New return Gtk_Image;
Creates a new empty Gtk.Image.Gtk_Image widget.

Gtk_New

procedure Gtk_New 
(Image: out Gtk_Image;
Animation: Gdk.Pixbuf.Gdk_Pixbuf_Animation);

Initialize

procedure Initialize 
(Image: not null access Gtk_Image_Record'Class;
Animation: Gdk.Pixbuf.Gdk_Pixbuf_Animation);
Creates a Gtk.Image.Gtk_Image displaying the given animation. The Gtk.Image.Gtk_Image does not assume a reference to the animation; you still need to unref it if you own references. Gtk.Image.Gtk_Image will add its own reference rather than adopting yours. Note that the animation frames are shown using a timeout with G_PRIORITY_DEFAULT. When using animations to indicate busyness, keep in mind that the animation will only be shown if the main loop is not busy with something that has a higher priority. "animation": an animation

Gtk_Image_New_From_Animation

function Gtk_Image_New_From_Animation 
(Animation: Gdk.Pixbuf.Gdk_Pixbuf_Animation) return Gtk_Image;
Creates a Gtk.Image.Gtk_Image displaying the given animation. The Gtk.Image.Gtk_Image does not assume a reference to the animation; you still need to unref it if you own references. Gtk.Image.Gtk_Image will add its own reference rather than adopting yours. Note that the animation frames are shown using a timeout with G_PRIORITY_DEFAULT. When using animations to indicate busyness, keep in mind that the animation will only be shown if the main loop is not busy with something that has a higher priority. "animation": an animation

Gtk_New

procedure Gtk_New 
(Image: out Gtk_Image;
Filename: UTF8_String);

Initialize

procedure Initialize 
(Image: not null access Gtk_Image_Record'Class;
Filename: UTF8_String);
Creates a new Gtk.Image.Gtk_Image displaying the file Filename. If the file isn't found or can't be loaded, the resulting Gtk.Image.Gtk_Image will display a "broken image" icon. This function never returns null, it always returns a valid Gtk.Image.Gtk_Image widget. If the file contains an animation, the image will contain an animation. If you need to detect failures to load the file, use Gdk.Pixbuf.Gdk_New_From_File to load the file yourself, then create the Gtk.Image.Gtk_Image from the pixbuf. (Or for animations, use Gdk.Pixbuf.Gdk_New_From_File). The storage type (gtk_image_get_storage_type) of the returned image is not defined, it will be whatever is appropriate for displaying the file. "filename": a filename

Gtk_Image_New_From_File

function Gtk_Image_New_From_File 
(Filename: UTF8_String) return Gtk_Image;
Creates a new Gtk.Image.Gtk_Image displaying the file Filename. If the file isn't found or can't be loaded, the resulting Gtk.Image.Gtk_Image will display a "broken image" icon. This function never returns null, it always returns a valid Gtk.Image.Gtk_Image widget. If the file contains an animation, the image will contain an animation. If you need to detect failures to load the file, use Gdk.Pixbuf.Gdk_New_From_File to load the file yourself, then create the Gtk.Image.Gtk_Image from the pixbuf. (Or for animations, use Gdk.Pixbuf.Gdk_New_From_File). The storage type (gtk_image_get_storage_type) of the returned image is not defined, it will be whatever is appropriate for displaying the file. "filename": a filename

Gtk_New_From_Gicon

procedure Gtk_New_From_Gicon 
(Image: out Gtk_Image;
Icon: Glib.G_Icon.G_Icon;
Size: Gtk.Enums.Gtk_Icon_Size);

Initialize_From_Gicon

procedure Initialize_From_Gicon 
(Image: not null access Gtk_Image_Record'Class;
Icon: Glib.G_Icon.G_Icon;
Size: Gtk.Enums.Gtk_Icon_Size);
Creates a Gtk.Image.Gtk_Image displaying an icon from the current icon theme. If the icon name isn't known, a "broken image" icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately. Since: gtk+ 2.14 "icon": an icon "size": a stock icon size

Gtk_Image_New_From_Gicon

function Gtk_Image_New_From_Gicon 
(Icon: Glib.G_Icon.G_Icon;
Size: Gtk.Enums.Gtk_Icon_Size) return Gtk_Image;
Creates a Gtk.Image.Gtk_Image displaying an icon from the current icon theme. If the icon name isn't known, a "broken image" icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately. Since: gtk+ 2.14 "icon": an icon "size": a stock icon size

Gtk_New_From_Icon_Name

procedure Gtk_New_From_Icon_Name 
(Image: out Gtk_Image;
Icon_Name: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size);

Initialize_From_Icon_Name

procedure Initialize_From_Icon_Name 
(Image: not null access Gtk_Image_Record'Class;
Icon_Name: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size);
Creates a Gtk.Image.Gtk_Image displaying an icon from the current icon theme. If the icon name isn't known, a "broken image" icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately. Since: gtk+ 2.6 "icon_name": an icon name "size": a stock icon size

Gtk_Image_New_From_Icon_Name

function Gtk_Image_New_From_Icon_Name 
(Icon_Name: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size) return Gtk_Image;
Creates a Gtk.Image.Gtk_Image displaying an icon from the current icon theme. If the icon name isn't known, a "broken image" icon will be displayed instead. If the current icon theme is changed, the icon will be updated appropriately. Since: gtk+ 2.6 "icon_name": an icon name "size": a stock icon size

Gtk_New

procedure Gtk_New 
(Image: out Gtk_Image;
Icon_Set: Gtk.Icon_Set.Gtk_Icon_Set;
Size: Gtk.Enums.Gtk_Icon_Size);

Initialize

procedure Initialize 
(Image: not null access Gtk_Image_Record'Class;
Icon_Set: Gtk.Icon_Set.Gtk_Icon_Set;
Size: Gtk.Enums.Gtk_Icon_Size);
Creates a Gtk.Image.Gtk_Image displaying an icon set. Sample stock sizes are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. Instead of using this function, usually it's better to create a Gtk.Icon_Factory.Gtk_Icon_Factory, put your icon sets in the icon factory, add the icon factory to the list of default factories with Gtk.Icon_Factory.Add_Default, and then use Gtk.Image.Gtk_New. This will allow themes to override the icon you ship with your application. The Gtk.Image.Gtk_Image does not assume a reference to the icon set; you still need to unref it if you own references. Gtk.Image.Gtk_Image will add its own reference rather than adopting yours. "icon_set": a Gtk.Icon_Set.Gtk_Icon_Set "size": a stock icon size

Gtk_Image_New_From_Icon_Set

function Gtk_Image_New_From_Icon_Set 
(Icon_Set: Gtk.Icon_Set.Gtk_Icon_Set;
Size: Gtk.Enums.Gtk_Icon_Size) return Gtk_Image;
Creates a Gtk.Image.Gtk_Image displaying an icon set. Sample stock sizes are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. Instead of using this function, usually it's better to create a Gtk.Icon_Factory.Gtk_Icon_Factory, put your icon sets in the icon factory, add the icon factory to the list of default factories with Gtk.Icon_Factory.Add_Default, and then use Gtk.Image.Gtk_New. This will allow themes to override the icon you ship with your application. The Gtk.Image.Gtk_Image does not assume a reference to the icon set; you still need to unref it if you own references. Gtk.Image.Gtk_Image will add its own reference rather than adopting yours. "icon_set": a Gtk.Icon_Set.Gtk_Icon_Set "size": a stock icon size

Gtk_New

procedure Gtk_New 
(Image: out Gtk_Image;
Pixbuf: access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class);

Initialize

procedure Initialize 
(Image: not null access Gtk_Image_Record'Class;
Pixbuf: access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class);
Creates a new Gtk.Image.Gtk_Image displaying Pixbuf. The Gtk.Image.Gtk_Image does not assume a reference to the pixbuf; you still need to unref it if you own references. Gtk.Image.Gtk_Image will add its own reference rather than adopting yours. Note that this function just creates an Gtk.Image.Gtk_Image from the pixbuf. The Gtk.Image.Gtk_Image created will not react to state changes. Should you want that, you should use Gtk.Image.Gtk_New. "pixbuf": a Gdk.Pixbuf.Gdk_Pixbuf, or null

Gtk_Image_New_From_Pixbuf

function Gtk_Image_New_From_Pixbuf 
(Pixbuf: access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class) return Gtk_Image;
Creates a new Gtk.Image.Gtk_Image displaying Pixbuf. The Gtk.Image.Gtk_Image does not assume a reference to the pixbuf; you still need to unref it if you own references. Gtk.Image.Gtk_Image will add its own reference rather than adopting yours. Note that this function just creates an Gtk.Image.Gtk_Image from the pixbuf. The Gtk.Image.Gtk_Image created will not react to state changes. Should you want that, you should use Gtk.Image.Gtk_New. "pixbuf": a Gdk.Pixbuf.Gdk_Pixbuf, or null

Gtk_New_From_Resource

procedure Gtk_New_From_Resource 
(Image: out Gtk_Image;
Resource_Path: UTF8_String);

Initialize_From_Resource

procedure Initialize_From_Resource 
(Image: not null access Gtk_Image_Record'Class;
Resource_Path: UTF8_String);
Creates a new Gtk.Image.Gtk_Image displaying the resource file Resource_Path. If the file isn't found or can't be loaded, the resulting Gtk.Image.Gtk_Image will display a "broken image" icon. This function never returns null, it always returns a valid Gtk.Image.Gtk_Image widget. If the file contains an animation, the image will contain an animation. If you need to detect failures to load the file, use Gdk.Pixbuf.Gdk_New_From_File to load the file yourself, then create the Gtk.Image.Gtk_Image from the pixbuf. (Or for animations, use Gdk.Pixbuf.Gdk_New_From_File). The storage type (gtk_image_get_storage_type) of the returned image is not defined, it will be whatever is appropriate for displaying the file. Since: gtk+ 3.4 "resource_path": a resource path

Gtk_Image_New_From_Resource

function Gtk_Image_New_From_Resource 
(Resource_Path: UTF8_String) return Gtk_Image;
Creates a new Gtk.Image.Gtk_Image displaying the resource file Resource_Path. If the file isn't found or can't be loaded, the resulting Gtk.Image.Gtk_Image will display a "broken image" icon. This function never returns null, it always returns a valid Gtk.Image.Gtk_Image widget. If the file contains an animation, the image will contain an animation. If you need to detect failures to load the file, use Gdk.Pixbuf.Gdk_New_From_File to load the file yourself, then create the Gtk.Image.Gtk_Image from the pixbuf. (Or for animations, use Gdk.Pixbuf.Gdk_New_From_File). The storage type (gtk_image_get_storage_type) of the returned image is not defined, it will be whatever is appropriate for displaying the file. Since: gtk+ 3.4 "resource_path": a resource path

Gtk_New

procedure Gtk_New 
(Image: out Gtk_Image;
Stock_Id: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size);

Initialize

procedure Initialize 
(Image: not null access Gtk_Image_Record'Class;
Stock_Id: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size);
Creates a Gtk.Image.Gtk_Image displaying a stock icon. Sample stock icon names are GTK_STOCK_OPEN, GTK_STOCK_QUIT. Sample stock sizes are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. If the stock icon name isn't known, the image will be empty. You can register your own stock icon names, see Gtk.Icon_Factory.Add_Default and Gtk.Icon_Factory.Add. "stock_id": a stock icon name "size": a stock icon size

Gtk_Image_New_From_Stock

function Gtk_Image_New_From_Stock 
(Stock_Id: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size) return Gtk_Image;
Creates a Gtk.Image.Gtk_Image displaying a stock icon. Sample stock icon names are GTK_STOCK_OPEN, GTK_STOCK_QUIT. Sample stock sizes are GTK_ICON_SIZE_MENU, GTK_ICON_SIZE_SMALL_TOOLBAR. If the stock icon name isn't known, the image will be empty. You can register your own stock icon names, see Gtk.Icon_Factory.Add_Default and Gtk.Icon_Factory.Add. "stock_id": a stock icon name "size": a stock icon size

Get_Type

function Get_Type return Glib.GType;

Clear

procedure Clear 
(Image: not null access Gtk_Image_Record);
Resets the image to be empty. Since: gtk+ 2.8

Get

function Get 
(Image: not null access Gtk_Image_Record) return Gdk.Pixbuf.Gdk_Pixbuf_Animation;
Gets the Gdk_Pixbuf_Animation being displayed by the Gtk.Image.Gtk_Image. The storage type of the image must be Gtk.Image.Image_Empty or Gtk.Image.Image_Animation (see Gtk.Image.Get_Storage_Type). The caller of this function does not own a reference to the returned animation.

Get

procedure Get 
(Image: not null access Gtk_Image_Record;
G_Icon: out Glib.G_Icon.G_Icon;
Size: out Gtk.Enums.Gtk_Icon_Size);
Gets the Glib.G_Icon.G_Icon and size being displayed by the Gtk.Image.Gtk_Image. The storage type of the image must be Gtk.Image.Image_Empty or Gtk.Image.Image_Gicon (see Gtk.Image.Get_Storage_Type). The caller of this function does not own a reference to the returned Glib.G_Icon.G_Icon. Since: gtk+ 2.14 "gicon": place to store a Glib.G_Icon.G_Icon, or null "size": place to store an icon size, or null

Get

procedure Get 
(Image: not null access Gtk_Image_Record;
Icon_Set: out Gtk.Icon_Set.Gtk_Icon_Set;
Size: out Gtk.Enums.Gtk_Icon_Size);
Gets the icon set and size being displayed by the Gtk.Image.Gtk_Image. The storage type of the image must be Gtk.Image.Image_Empty or Gtk.Image.Image_Icon_Set (see Gtk.Image.Get_Storage_Type). "icon_set": location to store a Gtk.Icon_Set.Gtk_Icon_Set, or null "size": location to store a stock icon size, or null

Get

function Get 
(Image: not null access Gtk_Image_Record) return Gdk.Pixbuf.Gdk_Pixbuf;
Gets the Gdk.Pixbuf.Gdk_Pixbuf being displayed by the Gtk.Image.Gtk_Image. The storage type of the image must be Gtk.Image.Image_Empty or Gtk.Image.Image_Pixbuf (see Gtk.Image.Get_Storage_Type). The caller of this function does not own a reference to the returned pixbuf.

Get_Pixel_Size

function Get_Pixel_Size 
(Image: not null access Gtk_Image_Record) return Gint;
Gets the pixel size used for named icons. Since: gtk+ 2.6

Set_Pixel_Size

procedure Set_Pixel_Size 
(Image: not null access Gtk_Image_Record;
Pixel_Size: Gint);
Sets the pixel size to use for named icons. If the pixel size is set to a value != -1, it is used instead of the icon size set by Gtk.Image.Set_From_Icon_Name. Since: gtk+ 2.6 "pixel_size": the new pixel size

Get_Storage_Type

function Get_Storage_Type 
(Image: not null access Gtk_Image_Record) return Gtk_Image_Type;
Gets the type of representation being used by the Gtk.Image.Gtk_Image to store image data. If the Gtk.Image.Gtk_Image has no image data, the return value will be Gtk.Image.Image_Empty.

Set

procedure Set 
(Image: not null access Gtk_Image_Record;
Animation: Gdk.Pixbuf.Gdk_Pixbuf_Animation);
Causes the Gtk.Image.Gtk_Image to display the given animation (or display nothing, if you set the animation to null). "animation": the Gdk_Pixbuf_Animation

Set

procedure Set 
(Image: not null access Gtk_Image_Record;
Filename: UTF8_String := "");
See Gtk.Image.Gtk_New for details. "filename": a filename or null

Set

procedure Set 
(Image: not null access Gtk_Image_Record;
Icon: Glib.G_Icon.G_Icon;
Size: Gtk.Enums.Gtk_Icon_Size);
See Gtk.Image.Gtk_New_From_Gicon for details. Since: gtk+ 2.14 "icon": an icon "size": an icon size

Set

procedure Set 
(Image: not null access Gtk_Image_Record;
Icon_Set: Gtk.Icon_Set.Gtk_Icon_Set;
Size: Gtk.Enums.Gtk_Icon_Size);
See Gtk.Image.Gtk_New for details. "icon_set": a Gtk.Icon_Set.Gtk_Icon_Set "size": a stock icon size

Set

procedure Set 
(Image: not null access Gtk_Image_Record;
Pixbuf: access Gdk.Pixbuf.Gdk_Pixbuf_Record'Class);
See Gtk.Image.Gtk_New for details. "pixbuf": a Gdk.Pixbuf.Gdk_Pixbuf or null

Set

procedure Set 
(Image: not null access Gtk_Image_Record;
Stock_Id: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size);
See Gtk.Image.Gtk_New for details. "stock_id": a stock icon name "size": a stock icon size

Set_From_Icon_Name

procedure Set_From_Icon_Name 
(Image: not null access Gtk_Image_Record;
Icon_Name: UTF8_String;
Size: Gtk.Enums.Gtk_Icon_Size);
See Gtk.Image.Gtk_New_From_Icon_Name for details. Since: gtk+ 2.6 "icon_name": an icon name "size": an icon size

Set_From_Resource

procedure Set_From_Resource 
(Image: not null access Gtk_Image_Record;
Resource_Path: UTF8_String := "");
See Gtk.Image.Gtk_New_From_Resource for details. "resource_path": a resource path or null

Get

function Get 
(Image: access Gtk_Image_Record;
Size: access Gtk.Enums.Gtk_Icon_Size) return String;
Get the stock_id for the image displayed

Get_Icon_Name

procedure Get_Icon_Name 
(Image: access Gtk_Image_Record;
Name: out GNAT.Strings.String_Access;
Size: out Gtk.Enums.Gtk_Icon_Size);