GnomeIconTextItem

Name

GnomeIconTextItem — Editable text canvas-item for icons.

Synopsis


#include <gnome.h>


struct      GnomeIconTextItem;
void        gnome_icon_text_item_configure  (GnomeIconTextItem *iti,
                                             int x,
                                             int y,
                                             int width,
                                             const char *fontname,
                                             const char *text,
                                             gboolean is_editable,
                                             gboolean is_static);
void        gnome_icon_text_item_setxy      (GnomeIconTextItem *iti,
                                             int x,
                                             int y);
void        gnome_icon_text_item_select     (GnomeIconTextItem *iti,
                                             int sel);
char*       gnome_icon_text_item_get_text   (GnomeIconTextItem *iti);
void        gnome_icon_text_item_stop_editing
                                            (GnomeIconTextItem *iti,
                                             gboolean accept);

Object Hierarchy


  GtkObject
   +----GnomeCanvasItem
         +----GnomeIconTextItem

Description

Provides a specialized canvas item for displaying icon captions which can be interactively changed by the user.

This Canvas item is used by the GnomeIconList and by the desktop icons provided by the GNOME file manager.

Details

struct GnomeIconTextItem

struct GnomeIconTextItem;


gnome_icon_text_item_configure ()

void        gnome_icon_text_item_configure  (GnomeIconTextItem *iti,
                                             int x,
                                             int y,
                                             int width,
                                             const char *fontname,
                                             const char *text,
                                             gboolean is_editable,
                                             gboolean is_static);

This routine is used to configure a GnomeIconTextItem.

x,y specify the cordinates where the item is placed inside the canvas width is the maximum allowed width for this icon.

if is_static is true, it means that there is no need for the item to allocate memory for the string (it is a guarantee that the text is allocated in the parent and it wont be deallocated during the life time of this item). This is an optimization to reduce memory usage for large icon-lists.

iti : The GnomeIconTextItem object
x : Canvas position to place the object
y : Canvas position to place the object
width : The allowed width for this object, in pixels
fontname : Font that should be used to display the text
text : The text that is going to be displayed.
is_editable : Whether editing is enabled for this item
is_static : Whether the string is allocated and wont go away.


gnome_icon_text_item_setxy ()

void        gnome_icon_text_item_setxy      (GnomeIconTextItem *iti,
                                             int x,
                                             int y);

Puts the GnomeIconTextItem in the canvas location specified by the x and y parameters

iti : The GnomeIconTextItem object
x : canvas x position
y : canvas y position


gnome_icon_text_item_select ()

void        gnome_icon_text_item_select     (GnomeIconTextItem *iti,
                                             int sel);

This is used to control the way the selection is displayed for a GnomeIconTextItem object

iti : The GnomeIconTextItem object
sel : boolean flag, if true the text should be displayed as selected otherwise not


gnome_icon_text_item_get_text ()

char*       gnome_icon_text_item_get_text   (GnomeIconTextItem *iti);

iti : The GnomeIconTextItem object
Returns :the text contained to a GnomeIconTextItem


gnome_icon_text_item_stop_editing ()

void        gnome_icon_text_item_stop_editing
                                            (GnomeIconTextItem *iti,
                                             gboolean accept);

iti : 
accept :