1 | from gi.repository import Gtk |
---|
2 | from gi.repository import Gdk |
---|
3 | |
---|
4 | x = 0 |
---|
5 | |
---|
6 | class FrameWindow(Gtk.Window): |
---|
7 | def __init__(self): |
---|
8 | Gtk.Window.__init__(self) |
---|
9 | self.set_has_resize_grip(False) |
---|
10 | self.resize(100, Gdk.Screen.height()) |
---|
11 | self.set_decorated(False) |
---|
12 | |
---|
13 | def do_draw(self, cr): |
---|
14 | # Draw the inner border as a rectangle |
---|
15 | r, g, b, a = 0, 0, 0, 1 |
---|
16 | cr.set_source_rgba(r, g, b, a) |
---|
17 | |
---|
18 | allocation = self.get_allocation() |
---|
19 | cr.rectangle(allocation.x, allocation.y, |
---|
20 | allocation.width, allocation.height) |
---|
21 | cr.fill() |
---|
22 | |
---|
23 | |
---|
24 | window = Gtk.Window() |
---|
25 | window.connect("delete-event", Gtk.main_quit) |
---|
26 | window.show() |
---|
27 | |
---|
28 | frame_panel = FrameWindow() |
---|
29 | frame_panel.show() |
---|
30 | |
---|
31 | def tick_cb(widget, frame_clock, bla): |
---|
32 | global x |
---|
33 | x += 1 |
---|
34 | widget.move(x, 0) |
---|
35 | |
---|
36 | return True |
---|
37 | |
---|
38 | frame_panel.move(x, 0) |
---|
39 | frame_panel.add_tick_callback(tick_cb, None) |
---|
40 | |
---|
41 | Gtk.main() |
---|