File: rectangle_on_click.e

package info (click to toggle)
egtk 0.3.6-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,984 kB
  • ctags: 5,256
  • sloc: ansic: 2,320; sh: 273; makefile: 234
file content (31 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (3)
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
class RECTANGLE_ON_CLICK

inherit

	ON_CLICK

creation

	make

feature

	width, height: INTEGER

	execute is
		local
			drawable: GDK_WINDOW
			h, w: INTEGER
		do
			print ("rectangle_on_click %N")
			drawable := area.window
			h := area.height
			w := area.width
			width := (width + 5) \\ w
			height := (height + 5) \\ h

			-- draw a rectangle
			drawable.draw_rectangle (area.style.black_gc, False, 2, 2, width, height)
		end

end