Imported Upstream version 0.2.85
[debian/pino.git] / src / menu_indicator.vala
1 using Gtk;
2
3 public class MenuIndicator : MenuItem {
4         
5         private Label tlabel;
6         private Spinner spin;
7         private Window main_window;
8         
9         public MenuIndicator(Window main_window) {
10                 this.main_window = main_window;
11                 remove(get_child());
12                 
13                 tlabel = new Label("some text");
14                 spin = new Spinner();
15                 spin.show();
16                 tlabel.show();
17                 HBox hb = new HBox(false, 5);
18                 hb.pack_start(tlabel, false, false, 0);
19                 hb.pack_start(spin, false, false, 0);
20                 
21                 add(hb);
22                 right_justified = true;
23         }
24         
25         public void add_queue(string text) {
26                 main_window.get_window().set_cursor(new Gdk.Cursor(Gdk.CursorType.WATCH));
27                 
28                 show_all();
29                 spin.start();
30                 tlabel.set_text(text);
31         }
32         
33         public void hide_queue() {
34                 spin.stop();
35                 hide_all();
36                 
37                 main_window.get_window().set_cursor(null);
38         }
39 }