~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/xwt/Samples/Samples/NotebookSample.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using Xwt;
 
3
using Xwt.Drawing;
 
4
 
 
5
namespace Samples
 
6
{
 
7
        public class NotebookSample: VBox
 
8
        {
 
9
                public NotebookSample ()
 
10
                {
 
11
                        Notebook nb = new Notebook ();
 
12
                        nb.Add (new Label ("First tab content"), "First Tab");
 
13
                        nb.Add (new MyWidget (), "Second Tab");
 
14
                        nb.TabOrientation = NotebookTabOrientation.Bottom;
 
15
                        PackStart (nb, BoxMode.FillAndExpand);
 
16
                }
 
17
        }
 
18
        
 
19
        class MyWidget: Canvas
 
20
        {
 
21
                protected override void OnDraw (Context ctx, Rectangle dirtyRect)
 
22
                {
 
23
                        ctx.SetLineWidth (5);
 
24
                        ctx.SetColor (new Color (1.0f, 0f, 0.5f));
 
25
                        ctx.Rectangle (5, 5, 200, 100);
 
26
                        ctx.FillPreserve ();
 
27
                        ctx.SetColor (new Color (0f, 0f, 1f));
 
28
                        ctx.Stroke ();
 
29
                }
 
30
        }
 
31
}
 
32