MateWeatherLocationEntry

MateWeatherLocationEntry

Synopsis

                    MateWeatherLocationEntry;
GtkWidget *         mateweather_location_entry_new      (MateWeatherLocation *top);
void                mateweather_location_entry_set_location
                                                        (MateWeatherLocationEntry *entry,
                                                         MateWeatherLocation *loc);
MateWeatherLocation * mateweather_location_entry_get_location
                                                        (MateWeatherLocationEntry *entry);
gboolean            mateweather_location_entry_set_city (MateWeatherLocationEntry *entry,
                                                         const char *city_name,
                                                         const char *code);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkEntry
                           +----MateWeatherLocationEntry

Implemented Interfaces

MateWeatherLocationEntry implements AtkImplementorIface, GtkBuildable, GtkEditable and GtkCellEditable.

Properties

  "location"                 gpointer              : Read / Write
  "top"                      gpointer              : Write / Construct Only

Description

Details

MateWeatherLocationEntry

typedef struct _MateWeatherLocationEntry MateWeatherLocationEntry;

A subclass of GtkEntry that provides autocompletion on MateWeatherLocations


mateweather_location_entry_new ()

GtkWidget *         mateweather_location_entry_new      (MateWeatherLocation *top);

Creates a new MateWeatherLocationEntry.

top will normally be a location returned from mateweather_location_new_world(), but you can create an entry that only accepts a smaller set of locations if you want.

top :

the top-level location for the entry.

Returns :

the new MateWeatherLocationEntry

mateweather_location_entry_set_location ()

void                mateweather_location_entry_set_location
                                                        (MateWeatherLocationEntry *entry,
                                                         MateWeatherLocation *loc);

Sets entry's location to loc, and updates the text of the entry accordingly.

entry :

a MateWeatherLocationEntry

loc :

a MateWeatherLocation in entry, or NULL to clear entry. [allow-none]

mateweather_location_entry_get_location ()

MateWeatherLocation * mateweather_location_entry_get_location
                                                        (MateWeatherLocationEntry *entry);

Gets the location that was set by a previous call to mateweather_location_entry_set_location() or was selected by the user.

entry :

a MateWeatherLocationEntry

Returns :

the selected location (which you must unref when you are done with it), or NULL if no location is selected. [transfer full][allow-none]

mateweather_location_entry_set_city ()

gboolean            mateweather_location_entry_set_city (MateWeatherLocationEntry *entry,
                                                         const char *city_name,
                                                         const char *code);

Sets entry's location to a city with the given code, and given city_name, if non-NULL. If there is no matching city, sets entry's location to NULL.

entry :

a MateWeatherLocationEntry

city_name :

the city name, or NULL. [allow-none]

code :

the METAR station code

Returns :

TRUE if entry's location could be set to a matching city, FALSE otherwise.

Property Details

The "location" property

  "location"                 gpointer              : Read / Write

The selected MateWeatherLocation.


The "top" property

  "top"                      gpointer              : Write / Construct Only

The MateWeatherLocation whose children will be used to fill in the entry.