~ubuntu-branches/ubuntu/natty/gtk-sharp2/natty

« back to all changes in this revision

Viewing changes to sample/CustomCellRenderer.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2010-05-18 00:00:41 UTC
  • mfrom: (1.1.16 upstream) (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100518000041-tlgvki554jx6ndhi
Tags: 2.12.10-1
* New upstream release
* debian/rules:
  + Bump API version to 2.12.10
* debian/control:
  + Bump Standards to 3.8.4 (no changes needed)
* debian/source/format:
  + Force Debian source format 1.0
* debian/rules:
  + Write a get-orig-source rule
* debian/watch:
  + Get rid of evil "debian uupdate" line which breaks packaging work on
    Ubuntu
* debian/patches/01_dllmaps.dpatch:
  + Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
{
16
16
 
17
17
        private float percent;
18
 
        
 
18
 
 
19
        [GLib.Property ("percent")]
19
20
        public float Percentage
20
21
        {
21
22
                get {
83
84
        }
84
85
 
85
86
        ListStore liststore;
86
 
 
87
 
        void ProgressData (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel tree_model, Gtk.TreeIter iter)
88
 
        {
89
 
                float perc = (float) liststore.GetValue (iter, 0);
90
 
                ((CustomCellRenderer)cell).Percentage = perc;
91
 
        }
92
87
        
93
88
        public Driver () : base ("CustomCellRenderer")
94
89
        {
101
96
                TreeView view = new TreeView (liststore);
102
97
 
103
98
                view.AppendColumn ("Progress", new CellRendererText (), "text", 1);
104
 
                
105
 
                //Note: This *MUST* be done here, as its the only place Progress is
106
 
                //accessible. Maybe there should be an attribute that will do some
107
 
                //magic for you and register a property with the gobject system.
108
 
                view.AppendColumn ("Progress", new CustomCellRenderer (), new TreeCellDataFunc (ProgressData));
 
99
                view.AppendColumn ("Progress", new CustomCellRenderer (), "percent", 0);
109
100
                
110
101
                this.Add (view);
111
102
                this.ShowAll ();