summaryrefslogtreecommitdiffstats
path: root/qtsharp/src/examples/samples/qstring-slot.cs
blob: af2db0a2d9ccbb2e3d67d39a90f4f1833f8d5603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Demo of a TTQString slot
// Implemented by Marcus Urban

using System;
using Qt;

public class MyWidget : TQVBox
{
	TTQLineEdit lineEdit;
	TTQLabel label;

	public MyWidget (TTQWidget parent, String name) : base (parent, name)
	{
		lineEdit = new TTQLineEdit( this, "lineEdit" );
		label = new TTQLabel( this, "label" );
		label.SetText("Default");
		
		TTQObject.Connect( lineEdit, TQT_SIGNAL("textChanged(TTQString)"),
			label, "SetText(TTQString)" );
	}


	public MyWidget (TTQWidget parent) : this (parent, "") {}
	public MyWidget () : this (null, "") {}
}

public class Example {

	public static int Main (String[] args)
	{
		TTQApplication a = new TTQApplication (args);
		
		MyWidget w = new MyWidget ();
		a.SetMainWidget (w);
		w.Show ();
		return a.Exec ();
	}
}