SexyIconEntry

SexyIconEntry — A GtkEntry with support for inline icons.

Functions

Signals

void icon-pressed Action
void icon-released Action

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkObject
            ╰── GtkWidget
                ╰── GtkEntry
                    ╰── SexyIconEntry

Implemented Interfaces

SexyIconEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.

Description

SexyIconEntry is a GtkEntry with support for inline icons. They can appear on either side of the entry or on both sides. There's also built-in support for adding a clear button for clearing the entry. This widget is particularly useful as search fields.

Functions

sexy_icon_entry_new ()

GtkWidget *
sexy_icon_entry_new (void);

Creates a new SexyIconEntry widget.

Returns a new SexyIconEntry.


sexy_icon_entry_set_icon ()

void
sexy_icon_entry_set_icon (SexyIconEntry *entry,
                          SexyIconEntryPosition position,
                          GtkImage *icon);

Sets the icon shown in the entry

Parameters

entry

A SexyIconEntry.

 

position

Icon position.

 

icon

A GtkImage to set as the icon.

 

sexy_icon_entry_set_icon_highlight ()

void
sexy_icon_entry_set_icon_highlight (SexyIconEntry *entry,
                                    SexyIconEntryPosition position,
                                    gboolean highlight);

Determines whether the icon will highlight on mouse-over.

Parameters

entry

A SexyIconEntry;

 

position

Icon position.

 

highlight

TRUE if the icon should highlight on mouse-over

 

sexy_icon_entry_get_icon ()

GtkImage *
sexy_icon_entry_get_icon (const SexyIconEntry *entry,
                          SexyIconEntryPosition position);

Retrieves the image used for the icon

Parameters

entry

A SexyIconEntry.

 

position

Icon position.

 

Returns

A GtkImage.


sexy_icon_entry_get_icon_highlight ()

gboolean
sexy_icon_entry_get_icon_highlight (const SexyIconEntry *entry,
                                    SexyIconEntryPosition position);

Retrieves whether entry will highlight the icon on mouseover.

Parameters

entry

A SexyIconEntry.

 

position

Icon position.

 

Returns

TRUE if icon highlights.


sexy_icon_entry_add_clear_button ()

void
sexy_icon_entry_add_clear_button (SexyIconEntry *icon_entry);

A convenience function to add a clear button to the end of the entry. This is useful for search boxes.

Parameters

icon_entry

A SexyIconEntry.

 

Types and Values

struct SexyIconEntry

struct SexyIconEntry;

The SexyIconEntry struct contains private data only, and should be manipulated using the functions below.


enum SexyIconEntryPosition

The position used when setting or retrieving an icon.

Members

SEXY_ICON_ENTRY_PRIMARY

Icon at the beginning of the entry (left for LTR languages, right for RTL).

 

SEXY_ICON_ENTRY_SECONDARY

Icon at the end of the entry.

 

Signal Details

The “icon-pressed” signal

void
user_function (SexyIconEntry *entry,
               gint           icon_pos,
               gint           button,
               gpointer       user_data)

The ::icon-pressed signal is emitted when an icon is clicked.

Parameters

entry

The entry on which the signal is emitted.

 

icon_pos

The position of the clicked icon.

 

button

The mouse button clicked.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “icon-released” signal

void
user_function (SexyIconEntry *entry,
               gint           icon_pos,
               gint           button,
               gpointer       user_data)

The ::icon-released signal is emitted on the button release from a mouse click.

Parameters

entry

The entry on which the signal is emitted.

 

icon_pos

The position of the clicked icon.

 

button

The mouse button clicked.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action