2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 { "height_label", "Height", NULL },
26 { "state_label", "State", NULL },
27 { "rssi_label", "RSSI", NULL },
28 { "height_value", "0m", NULL },
29 { "state_value", "pad", NULL },
30 { "rssi_value", "-50dBm", NULL },
34 aoview_label_assign(GtkLabel *widget, char *value)
38 markup = g_markup_printf_escaped("<span font_weight=\"bold\" size=\"xx-large\">%s</span>", value);
39 gtk_label_set_markup(widget, markup);
44 aoview_label_show(struct aostate *state)
47 sprintf(line, "%dm", state->height);
48 aoview_label_assign(label_widgets[3].widget, line);
50 aoview_label_assign(label_widgets[4].widget, state->state);
52 sprintf(line, "%ddBm", state->rssi);
53 aoview_label_assign(label_widgets[5].widget, line);
57 aoview_label_init(GladeXML *xml)
60 for (i = 0; i < sizeof(label_widgets)/sizeof(label_widgets[0]); i++) {
61 label_widgets[i].widget = GTK_LABEL(glade_xml_get_widget(xml, label_widgets[i].name));
62 aoview_label_assign(label_widgets[i].widget, label_widgets[i].initial_value);
63 assert(label_widgets[i].widget);