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

Signal Prototypes


'text-changed'
            gboolean    user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);
'height-changed'
            void        user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);
'width-changed'
            void        user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);
'editing-started'
            void        user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);
'editing-stopped'
            void        user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);
'selection-started'
            void        user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);
'selection-stopped'
            void        user_function      (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

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


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 objectx : Canvas position to place the objecty : Canvas position to place the objectwidth : The allowed width for this object, in pixelsfontname : Font that should be used to display the texttext : The text that is going to be displayed.is_editable : Whether editing is enabled for this itemis_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 objectx : canvas x positiony : 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 objectsel : 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 objectReturns :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 : 

Signals


The 'text-changed' signal

gboolean    user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signal is emited when the text has been changed by the user. The signal handler should return FALSE if it does not accept the changes made to the text (for example, if it was unable to change the actual backing store name that this text represents).

If the signal handler returns FALSE, then the text is reset to its previous value.

icontextitem :the object which received the signal.user_data :user data set when the signal handler was connected.Returns :TRUE if the change is accepted, FALSE otherwise.


The 'height-changed' signal

void        user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signals is emited when the height of this item has changed (due to the user changing the name).

icontextitem :the object which received the signal. user_data :user data set when the signal handler was connected.


The 'width-changed' signal

void        user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signals is emited when the width of this item has changed (due to the user changing the name).

icontextitem :the object which received the signal. user_data :user data set when the signal handler was connected.


The 'editing-started' signal

void        user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signals is emited when the user has started editing the text on the item.

icontextitem :the object which received the signal. user_data :user data set when the signal handler was connected.


The 'editing-stopped' signal

void        user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signals is emited when the user has stopped editing the text on the item.

icontextitem :the object which received the signal. user_data :user data set when the signal handler was connected.


The 'selection-started' signal

void        user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signals is emited when the user has started selecting a region of the text.

icontextitem :the object which received the signal. user_data :user data set when the signal handler was connected.


The 'selection-stopped' signal

void        user_function                  (GnomeIconTextItem *icontextitem,
                                            gpointer user_data);

This signals is emited when the user has stopped selecting a region of the text.

icontextitem :the object which received the signal. user_data :user data set when the signal handler was connected.