![]() |
![]() |
![]() |
Yelp Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <yelp.h> YelpLocationEntry; YelpLocationEntryClass; GtkWidget * yelp_location_entry_new (YelpView *window
,YelpBookmarks *bookmarks
); void yelp_location_entry_start_search (YelpLocationEntry *entry
);
GObject +----GInitiallyUnowned +----GtkWidget +----GtkContainer +----GtkBin +----GtkComboBox +----YelpLocationEntry
YelpLocationEntry implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.
"bookmarks" YelpBookmarks* : Read / Write / Construct Only "enable-search" gboolean : Read / Write / Construct "view" YelpView* : Read / Write / Construct Only
YelpLocationEntry is a GtkComboBox designed to show the current location, provide a drop-down menu of previous locations, and allow the user to perform searches.
The GtkTreeModel used by a YelpLocationEntry is expected to have at least
four columns: "entry-text-column" contains the displayed name
of the location, "desc-column" contains a description
for each entry, "icon-column" contains an icon name for
the location, and "flags-column" contains a bit field
of YelpLocationEntryFlags. These columns are specified when creating a
YelpLocationEntry widget with yelp_location_entry_new_with_model()
.
Usually, a single row in the GtkTreeModel corresponds to a location. When a user selects a row from the drop-down menu, the icon and text for that row will be placed in the embedded text entry, and the "location-selected" signal will be emitted.
If a row has the YELP_LOCATION_ENTRY_IS_SEARCH
flag set, selecting that
row will not emit the "location-selected" signal. Instead,
the YelpLocationEntry widget will be placed into search mode, as if by a
call to yelp_location_entry_start_search()
.
When a row has the YELP_LOCATION_ENTRY_CAN_BOOKMARK
flag set, an icon
will be displayed in the secondary icon position of the embedded text
entry allowing the user to bookmark the location. Clicking this icon
will cause the FIXME signal to be emitted.
typedef struct { GtkComboBoxClass parent; void (* location_selected) (YelpLocationEntry *entry); void (* search_activated) (YelpLocationEntry *entry); void (* bookmark_clicked) (YelpLocationEntry *entry); /* Padding for future expansion */ void (*_gtk_reserved0) (void); void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void); } YelpLocationEntryClass;
GtkWidget * yelp_location_entry_new (YelpView *window
,YelpBookmarks *bookmarks
);
Creates a new YelpLocationEntry widget to control view
.
|
A YelpView. |
Returns : |
A new YelpLocationEntry. |
void yelp_location_entry_start_search (YelpLocationEntry *entry
);
Puts entry
into search mode. This focuses the entry and clears its text
contents. When the user activates the search, the
"search-activated" signal will be emitted.
|
A YelpLocationEntry. |
"bookmarks"
property "bookmarks" YelpBookmarks* : Read / Write / Construct Only
An instance of an implementation of YelpBookmarks to provide bookmark information for this location entry.
"enable-search"
property "enable-search" gboolean : Read / Write / Construct
Whether the location entry can act as a search entry. If search is not enabled, the user will not be able to initiate a search by clicking in the embedded text entry or selecting a search row in the drop-down menu.
Default value: TRUE
"view"
property"view" YelpView* : Read / Write / Construct Only
The YelpView instance that this location entry controls.
"bookmark-clicked"
signalvoid user_function (YelpLocationEntry *widget, gpointer user_data) : Run Last
This signal will be emitted whenever a user clicks the bookmark icon embedded in the location entry.
|
The YelpLocationEntry for which the signal was emitted. |
|
User data set when the handler was connected. |
|
user data set when the signal handler was connected. |
"location-selected"
signalvoid user_function (YelpLocationEntry *widget, gpointer user_data) : Run Last
This signal will be emitted whenever a user selects a normal row from the
drop-down menu. Note that if a row has the flag YELP_LOCATION_ENTRY_IS_SEARCH
,
clicking the row will cause widget
to enter search mode, and this signal
will not be emitted.
|
The YelpLocationEntry for which the signal was emitted. |
|
User data set when the handler was connected. |
|
user data set when the signal handler was connected. |
"search-activated"
signalvoid user_function (YelpLocationEntry *widget, gchar *text, gpointer user_data) : Run Last
This signal will be emitted whenever the user activates a search, generally
by pressing Enter in the embedded text entry while widget
is in search mode.
|
The YelpLocationEntry for which the signal was emitted. |
|
The search text. |
|
User data set when the handler was connected. |
|
user data set when the signal handler was connected. |