7 public class Display
: DisplayBase
{
9 public string time
{ get { return _time
; } set { _time
= value
; queue_draw (); } }
11 private int inner_height
;
16 inner_height
= height
- 13;
18 set_size_request (width
, height
);
21 protected override bool draw_contents (Cairo
.Context cr
, Gdk
.EventExpose event
) {
24 text(cr
, _time
, x
, y
, 16);
25 Cairo
.TextExtents ext
= Cairo
.TextExtents();
26 cr
.text_extents (_time
, ref ext
);
29 Color
.parse (text_color_default
, out line_color
);
30 set_source_from_color (cr
, line_color
, 0.5);
33 cr
.move_to (x
, y
+ ext
.y_bearing
);
34 cr
.rel_line_to (0, ext
.height
);
37 cr
.move_to (x
+ ext
.x_advance
+ ext
.x_bearing
, y
+ ext
.y_bearing
);
38 cr
.rel_line_to (0, ext
.height
);
42 cr
.move_to (3, inner_height
- 13);
43 cr
.rel_line_to (width
- 20, 0);
49 public class Jackpanel
: Alignment
{
52 var table
= new
Table (5, 2, false);
53 var display
= new
Display ();
54 var to_start
= new
TransportButton (TransportButton
.IconType
.TO_START
);
58 var fast_backward
= new
TransportButton (TransportButton
.IconType
.FAST_BACKWARD
);
59 fast_backward
.height
= 20;
60 fast_backward
.width
= 31;
62 var play
= new
TransportButton (TransportButton
.IconType
.PLAY
);
66 var stop
= new
TransportButton (TransportButton
.IconType
.STOP
);
70 var fast_forward
= new
TransportButton (TransportButton
.IconType
.FAST_FORWARD
);
71 fast_forward
.height
= 20;
72 fast_forward
.width
= 31;
74 table
.attach_defaults (display
, 0, 5, 0, 1);
76 table
.attach_defaults (to_start
, 0, 1, 1, 2);
77 table
.attach_defaults (fast_backward
, 1, 2, 1, 2);
78 table
.attach_defaults (fast_forward
, 2, 3, 1, 2);
79 table
.attach_defaults (stop
, 3, 4, 1, 2);
80 table
.attach_defaults (play
, 4, 5, 1, 2);
82 table
.set_col_spacing (0, 4);
83 table
.set_col_spacing (1, 4);
84 table
.set_col_spacing (2, 10);
85 table
.set_col_spacing (3, 4);
90 static int main (string[] args
) {
92 var window
= new Gtk
.Window (Gtk
.WindowType
.TOPLEVEL
);
93 var panel
= new
Jackpanel ();
95 window
.destroy
+= Gtk
.main_quit
;
102 } //namespace Jackpanel