PageRenderTime 15ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/examples/text/text_view_window.e

http://github.com/tybor/Liberty
Specman e | 46 lines | 37 code | 8 blank | 1 comment | 0 complexity | f4bf584d7b2827f7d57119287601d330 MD5 | raw file
 1class TEXT_VIEW_WINDOW
 2inherit
 3	GTK_WINDOW redefine make, on_destroy end
 4	GTK
 5creation make
 6
 7feature
 8
 9	make is
10		local
11			big: GTK_TEXT_TAG
12		do
13			Precursor
14			set_title (once "Text View demo")
15			midscreen
16			
17			create text.make
18			add (text)
19
20			text.buffer.set_text (some_string)
21			big := text.buffer.create_tag ("big", create {ARRAY[TUPLE[STRING, G_VALUE]]}.make (1, 0))
22			big.set_string_property ("foreground", "blue")
23			--	big.set_boolean_property ("size-set", True)
24			text.buffer.apply_tag (big,
25				text.buffer.iter_at_offset(0),
26				text.buffer.iter_at_offset(10))
27
28			enable_on_destroy
29		end
30
31feature -- Widgets
32	text: GTK_TEXT_VIEW
33
34	some_string: STRING is "[
35									What you see here is a text view.
36									It can show multiple lines of text. It can be edited, too.
37									You can put formatting and images inside it.
38									]"
39
40feature  -- Callbacks
41	on_destroy is
42		do
43			print ("Text view demo ending%N")
44			gtk.quit
45		end
46end