CafeWeatherLocationEntry: libcafeweather Reference Manual

## CafeWeatherLocationEntry CafeWeatherLocationEntry |

## Functions

CtkWidget * | cafeweather_location_entry_new ()
void | cafeweather_location_entry_set_location ()
CafeWeatherLocation * | cafeweather_location_entry_get_location ()
gboolean | cafeweather_location_entry_set_city ()

## Properties

gpointer | location | Read / Write
gpointer | top | Write / Construct Only

## Types and Values

| CafeWeatherLocationEntry

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── CtkWidget
                ╰── CtkEntry
                    ╰── CafeWeatherLocationEntry

## Implemented Interfaces

CafeWeatherLocationEntry implements AtkImplementorIface, CtkBuildable, CtkEditable and CtkCellEditable.

## Description

A subclass of CtkEntry that provides autocompletion on CafeWeatherLocations

## Functions

### cafeweather_location_entry_new ()

    CtkWidget *
    cafeweather_location_entry_new (CafeWeatherLocation *top);

Creates a new CafeWeatherLocationEntry.

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

#### Parameters

top | the top-level location for the entry. |

#### Returns

the new CafeWeatherLocationEntry

### cafeweather_location_entry_set_location ()

    void
    cafeweather_location_entry_set_location
                                   (CafeWeatherLocationEntry *entry,
                                    CafeWeatherLocation *loc);

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

#### Parameters

entry | a CafeWeatherLocationEntry |
loc | a CafeWeatherLocation in `entry` , or `NULL` to clear `entry` . | [allow-none]

### cafeweather_location_entry_get_location ()

    CafeWeatherLocation *
    cafeweather_location_entry_get_location
                                   (CafeWeatherLocationEntry *entry);

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

#### Parameters

entry | a CafeWeatherLocationEntry |

#### 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]

### cafeweather_location_entry_set_city ()

    gboolean
    cafeweather_location_entry_set_city (CafeWeatherLocationEntry *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`.

#### Parameters

entry | a CafeWeatherLocationEntry |
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.

## Types and Values

### CafeWeatherLocationEntry

    typedef struct _CafeWeatherLocationEntry CafeWeatherLocationEntry;

## Property Details

### The `“location”` property

      “location”                 gpointer

The selected CafeWeatherLocation.

Owner: CafeWeatherLocationEntry

Flags: Read / Write

### The `“top”` property

      “top”                      gpointer

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

Owner: CafeWeatherLocationEntry

Flags: Write / Construct Only