~ubuntu-branches/ubuntu/saucy/clinica/saucy

« back to all changes in this revision

Viewing changes to libclinica/ToolbarItem.vala

  • Committer: Package Import Robot
  • Author(s): Leonardo Robol
  • Date: 2013-07-15 11:27:05 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130715112705-3jskr3zv254a2qf2
Tags: 0.3.0-1
* New upstream version of Clinica.
* Remove explicit dependency on valac-0.16 (Closes: #709719)
* Correct FTBFS (Closes: #707361)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   This file is part of Clinica.
 
3
 *
 
4
 *   Clinica 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, either version 3 of the License, or
 
7
 *   (at your option) any later version.
 
8
 *
 
9
 *   Clinica is distributed in the hope that it will be useful,
 
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *   GNU General Public License for more details.
 
13
 *
 
14
 *   You should have received a copy of the GNU General Public License
 
15
 *   along with Clinica.  If not, see <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 *   Authors: Leonardo Robol <leo@robol.it>
 
18
 */
 
19
 
 
20
namespace Clinica {
 
21
 
 
22
    public class ToolbarItem : Gtk.ToolItem {
 
23
    
 
24
        public signal void activated ();
 
25
        
 
26
        private Gtk.Button button;
 
27
    
 
28
        public ToolbarItem (ResourceManager resources, string resource_path) {
 
29
            Object ();
 
30
            
 
31
            button = new Gtk.Button ();
 
32
            button.add (new Gtk.Image.from_resource (resource_path));
 
33
            button.set_relief (Gtk.ReliefStyle.NONE);
 
34
            
 
35
            button.clicked.connect ((button) => activated ());
 
36
            
 
37
            add (button);
 
38
        }
 
39
        
 
40
        public void set_active (bool sensitive) {
 
41
            button.set_sensitive (sensitive);
 
42
        }
 
43
        
 
44
        
 
45
    
 
46
    }
 
47
 
 
48
}