.
1 /*
2 Copyright (C) 2013 Johan Mattsson
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 3 of the
7 License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13 */
14
15 namespace BirdFont {
16
17 public class TextListener : GLib.Object {
18
19 public string label;
20 public string default_text;
21 public string button_label;
22
23 public signal void signal_text_input (string text);
24 public signal void signal_submit (string text);
25
26 private string text;
27
28 public TextListener (string label, string default_text, string button_label) {
29 this.label = label;
30 this.default_text = default_text;
31 this.button_label = button_label;
32 }
33
34 public void set_text (string t) {
35 text = t;
36 signal_text_input (text);
37 }
38
39 public void submit () {
40 signal_text_input (text);
41 signal_submit (text);
42 }
43 }
44
45 }
46