[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - Gtk::Image

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2005年 8月 29日 (月) 03:19:08 JST


-------------------------
REMOTE_ADDR = 83.78.8.17
REMOTE_HOST = 
REMOTE_USER = ruby-gnome2-hiki
        URL = /hiki.cgi?Gtk%3A%3AImage
-------------------------
@@ -34,25 +34,25 @@
 --- Gtk::Image.new(value = nil)
     Creates a new Gtk::Image.
     * value
-       * nil - Create a new empty Gtk::Image.
+       * nil - Creates a new empty Gtk::Image.
        * filename(String) - Creates a new Gtk::Image displaying the file filename. If the file isn't found or can't be loaded, the resulting Gtk::Image will display a "broken image" icon. This function never returns nil, it always returns a valid 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.new(filename) to load the file yourself, then create the Gtk::Image from the pixbuf. (Or for animations, use Gdk::PixbufAnimation.new(filenam. The storage type (Gtk::Image#storage_type) of the returned image is not defined, it will be whatever is appropriate for displaying the file.
-       * Gdk::Pixbuf - Create a new Gtk::Image from Gdk::Pixbuf. This function just creates an Gtk::Image. The Gtk::Image created will not react to state changes. Should you want that, you should use Gtk::IconSet.
+       * Gdk::Pixbuf - Creates a new Gtk::Image from Gdk::Pixbuf. This function just creates an Gtk::Image. The Gtk::Image created will not react to state changes. Should you want that, you should use Gtk::IconSet.
        * Gdk::PixbufAnimation - Creates a Gtk::Image displaying the given animation. The Gtk::Image does not assume a reference to the animation; you still need to unref it if you own references. Gtk::Image will add its own reference rather than adopting yours.
 
 --- Gtk::Image.new(stock_id, size)
     Creates a Gtk::Image displaying a stock icon. Sample stock icon names are Gtk::Stock::OPEN, Gtk::Stock::EXIT. Sample stock sizes are Gtk::IconSize::MENU, Gtk::IconSize::SMALL_TOOLBAR. If the stock icon name isn't known, a "broken image" icon will be displayed instead. You can register your own stock icon names, see Gtk::IconFactory#add_default and Gtk::IconFactory#add.
     * stock_id: stock icon (constants of Gtk::Stock)
-    * size: size (((<GtkIconSize|Gtk::IconSIze#GtkIconSize>)) - the constants of Gtk::IconSize)
+    * size: size (((<GtkIconSize|Gtk::IconSize#GtkIconSize>)) - the constants of Gtk::IconSize)
     
 --- Gtk::Image.new(image, mask)
     Creates a Gtk::Image widget displaying a image with a mask. A Gdk::Image is a client-side image buffer in the pixel format of the current display. The Gtk::Image does not assume a reference to the image or mask; you still need to unref them if you own references. Gtk::Image will add its own reference rather than adopting yours.
     * image: image (Gdk::Image).
-    * mask: mask (Gdk::Pixmap(depth = 1)
+    * mask: mask (Gdk::Pixmap) (depth = 1)
 
 --- Gtk::Image.new(pixmap, mask)
     Creates a Gtk::Image widget displaying pixmap with a mask. A Gdk::Image is a server-side image buffer in the pixel format of the current display. The Gtk::Image does not assume a reference to the pixmap or mask; you still need to unref them if you own references. Gtk::Image will add its own reference rather than adopting yours.
     * pixmap: pixmap (Gdk::Pixmap).
-    * mask: mask (Gdk::Pixmap(depth = 1)
+    * mask: mask (Gdk::Pixmap) (depth = 1)
 
 --- Gtk::Image.new(iconset, size)
     Creates a Gtk::Image displaying an icon set. Sample stock sizes are Gtk::IconSize::MENU, Gtk::IconSize::SMALL_TOOLBAR. Instead of using this method, usually it's better to create a Gtk::IconFactory, put your icon sets in the icon factory, add the icon factory to the list of default factories with Gtk::IconFactory#add_default, and then use Gtk::Image.new(stock_id, size). This will allow themes to override the icon you ship with your application. 
@@ -60,6 +60,12 @@
     * iconset: stock icon (constants of Gtk::Stock)
     * size: size (GtkIconSize - the constants of Gtk::IconSize)
 
+--- Gtk::Image.new(iconname, size)
+    Creates a new 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 2.6*))
+    * iconname: icon name (String)
+    * size: size (GtkIconSize - the constants of Gtk::IconSize)
+  
+
 == Instance Methods
 --- icon_set
     Gets the icon set being displayed by the Gtk::Image. The storage type of the image must be Gtk::Image::EMPTY or Gtk::Image::ICON_SET (see Gtk::Image#storage_type).
@@ -185,6 +191,24 @@
     * filename: the new filename(String).
     * Returns: self
 
+--- icon_name
+    Gets the icon name being displayed by the Gtk::Image. The storage type of the image must be Gtk::Image#EMPTY or Gtk::Image#ICON_NAME. ((*Since 2.6*))
+
+--- pixel_size
+    Gets the pixel size used for named icons. ((*Since 2.6*))
+
+--- pixel_size=(pixel_size)
+    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(iconname, size). ((*Since 2.6*))
+
+--- set_pixel_size(pixel_size)
+    Same as #pixel_size=. ((*Since 2.6*))
+
 --- set(value)
     Sets a new value. 
     * value
@@ -196,7 +214,25 @@
 --- set(stock_id, size)
     Sets a Gtk::Image displaying a stock icon. Sample stock icon names are Gtk::Stock::OPEN, Gtk::Stock::EXIT. Sample stock sizes are Gtk::IconSize::MENU, Gtk::IconSize::SMALL_TOOLBAR. If the stock icon name isn't known, a "broken image" icon will be displayed instead. You can register your own stock icon names, see Gtk::IconFactory#add_default and Gtk::IconFactory#add.
     * stock_id: stock icon (constants of Gtk::Stock)
-    * size: size (((<GtkIconSize|Gtk::IconSIze#GtkIconSize>)) - the constants of Gtk::IconSize)
+    * size: size (((<GtkIconSize|Gtk::IconSize#GtkIconSize>)) - the constants of Gtk::IconSize)
     * Returns: self
     
 --- set(image, mask)
@@ -215,8 +233,31 @@
     Sets a Gtk::Image displaying an icon set. Sample stock sizes are Gtk::IconSize::MENU, Gtk::IconSize::SMALL_TOOLBAR. Instead of using this method, usually it's better to create a Gtk::IconFactory, put your icon sets in the icon factory, add the icon factory to the list of default factories with Gtk::IconFactory#add_default, and then use Gtk::Image.new(stock_id, size). This will allow themes to override the icon you ship with your application. 
     The Gtk::Image does not assume a reference to the icon set; you still need to unref it if you own references. Gtk::Image will add its own reference rather than adopting yours.
     * iconset: stock icon (constants of Gtk::Stock)
-    * size: size (((<GtkIconSize|Gtk::IconSIze#GtkIconSize>)) - the constants of Gtk::IconSize)
+    * size: size (((<GtkIconSize|Gtk::IconSize#GtkIconSize>)) - the constants of Gtk::IconSize)
 
+--- set(iconname, size)
+    Sets 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 2.6*))
+    * iconname: an icon name
+    * size: size (((<GtkIconSize|Gtk::IconSize#GtkIconSize>)) - the constants of Gtk::IconSize)
+
 --- storage_type
     Gets the type(((<GtkImageType|Gtk::Image#GtkImageType>))) of representation being used by the Gtk::Image to store image data. If the Gtk::Image has no image data, the return value will be Gtk::Image::EMPTY.
     * Returns: storage_type(((<GtkImageType|Gtk::Image#GtkImageType>))).
@@ -239,16 +262,44 @@
     the widget contains a Gtk::IconSet.
 --- ANIMATION
     the widget contains a Gdk::PixbufAnimation.
+--- ICON_NAME
+    ((*Since 2.6*))
 
 == Properties
 --- file: String (Write)
     Filename to load and display
 
+--- icon-name: String (Read/Write)
+    The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically. ((*Since 2.6*))
+
 --- icon-set: Gtk::IconSet (Read/Write)
     Icon set to display
 
 --- icon-size: Integer (Read/Write)
-    Size to use for stock icon or icon set
+    Size to use for stock icon, icon set or named icon
 
 --- image: Gdk::Image (Read/Write)
     A Gdk::Image to display
@@ -270,6 +298,37 @@
 
 --- storage-type: Integer (Read)
     The representation being used for image data
+
+--- pixel-size: Integer (Read/Write)
+    This property can be used to specify a fixed size overriding the icon-size property for images of type Gtk::Image#ICON_NAME. Allowed values: >= -1. Default value: -1. ((*Since 2.6*))
 
 == See Also
 Gdk::Pixbuf





ruby-gnome2-cvs メーリングリストの案内
Back to archive index