~versable/estudio/estudio

« back to all changes in this revision

Viewing changes to src/UI/Widgets/Builder_Widget.vala

  • Committer: Chris Timberlake
  • Date: 2013-09-13 08:15:44 UTC
  • Revision ID: git-v1:a81e8a287bd7e509bb70f1845e2d7dd56a57a660
Moved Repo

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *    Copyright (c) 2013 Christopher Timberlake 
3
 
 *    <Chris@TimberlakeTechnologies.com> -or- <www.ChristopherTimberlake.com>
4
 
 *
5
 
 *    Permission is hereby granted, free of charge, to any person obtaining a copy
6
 
 *    of this software and associated documentation files (the "Software"), to deal
7
 
 *    in the Software without restriction, including without limitation the rights
8
 
 *    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 
 *    copies of the Software, and to permit persons to whom the Software is
10
 
 *    furnished to do so, subject to the following conditions:
11
 
 
12
 
 *    The above copyright notice and this permission notice shall be included in
13
 
 *    all copies or substantial portions of the Software.
14
 
 
15
 
 *    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 
 *    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 
 *    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 
 *    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 
 *    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 
 *    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 
 *    THE SOFTWARE.
22
 
 */
23
 
 
24
 
using Gtk;
25
 
namespace eStudio {
26
 
    class Builder_Widget : Gtk.InfoBar {
27
 
        public Gtk.Label message;
28
 
        public Gtk.ProgressBar progress;
29
 
        private Gtk.Container      content;
30
 
 
31
 
        public Builder_Widget() {
32
 
            content = (Gtk.Container)base.get_content_area ();
33
 
            message = new Gtk.Label("Building...");
34
 
            content.add (message);
35
 
            
36
 
            var action = base.get_action_area();
37
 
            var box = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0);
38
 
            
39
 
            progress = new Gtk.ProgressBar ();
40
 
            progress.set_show_text (true);
41
 
            progress.set_fraction(0.5);
42
 
            progress.set_size_request(10, 10);
43
 
            box.add(progress);
44
 
            
45
 
            
46
 
            var cancel = new Gtk.Button();
47
 
            try {
48
 
                var image = new Image.from_pixbuf(Gtk.IconTheme.get_default ().lookup_by_gicon (new ThemedIcon ("process-stop-symbolic"), 16, 0).load_symbolic ({0.33, 0.33, 0.33, 0.33}));
49
 
                cancel.set_image(image);
50
 
            } catch(GLib.Error err){
51
 
                stdout.printf("\n Error: %s", err.message);
52
 
            }
53
 
            box.add(cancel);
54
 
 
55
 
            base.add_action_widget(box, 0); 
56
 
            base.show_all();
57
 
        }
58
 
    }
59
 
}