Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 63 lines (49 sloc) 1.244 kb
391939f6 »
2011-07-22 basic grid implementation
1 import gtk
2
3ef0de14 »
2011-09-11 naive approach
3 from uxie.floating import FloatBox, TextFeedback
4 from uxie.utils import idle
391939f6 »
2011-07-22 basic grid implementation
5
6 w = gtk.Window(gtk.WINDOW_TOPLEVEL)
3ef0de14 »
2011-09-11 naive approach
7 w.set_default_size(800, 500)
391939f6 »
2011-07-22 basic grid implementation
8 w.connect('delete-event', gtk.main_quit)
9
10
3ef0de14 »
2011-09-11 naive approach
11 hp = gtk.HPaned()
12 hp.props.position = 400
13 w.add(hp)
391939f6 »
2011-07-22 basic grid implementation
14
3ef0de14 »
2011-09-11 naive approach
15 hv1 = gtk.VPaned()
16 hv1.props.position = 250
17 hp.add1(hv1)
18
19 hv2 = gtk.VPaned()
20 hv2.props.position = 250
21 hp.add2(hv2)
22
23 views = []
24 fboxes = []
25 for p in [hv1, hv2]:
26 for add in [p.add1, p.add2]:
d850c8e5 »
2011-09-29 floating manager
27 v = gtk.TextView()
3ef0de14 »
2011-09-11 naive approach
28 fb = FloatBox()
d850c8e5 »
2011-09-29 floating manager
29 #f = gtk.Frame()
3ef0de14 »
2011-09-11 naive approach
30 #f.add(v)
d850c8e5 »
2011-09-29 floating manager
31 fb.add(v)
3ef0de14 »
2011-09-11 naive approach
32 add(fb)
d850c8e5 »
2011-09-29 floating manager
33 views.append(v)
3ef0de14 »
2011-09-11 naive approach
34 fboxes.append(fb)
35
d850c8e5 »
2011-09-29 floating manager
36 for i, v in enumerate(views):
37 v.get_buffer().set_text('view%s' % i)
391939f6 »
2011-07-22 basic grid implementation
38
39 w.show_all()
40
d850c8e5 »
2011-09-29 floating manager
41 def debug_expose(widget):
42 def inner(widget, event):
43 print 'expose', widget, event
44
45 widget.connect_after('expose-event', inner)
46
3ef0de14 »
2011-09-11 naive approach
47 def do():
48 msg = TextFeedback('Wow', timeout=0)
d850c8e5 »
2011-09-29 floating manager
49 debug_expose(msg.widget)
50 debug_expose(msg.fb)
51 debug_expose(msg.box)
52 debug_expose(fboxes[0])
53 debug_expose(views[0])
54 debug_expose(msg.label)
3ef0de14 »
2011-09-11 naive approach
55 fboxes[0].add(msg.widget, -1, -1)
56 msg.widget.show_all()
d850c8e5 »
2011-09-29 floating manager
57 print msg.label.is_drawable()
3ef0de14 »
2011-09-11 naive approach
58 #msg.widget.queue_draw()
59 #fboxes[0].queue_draw()
60
61 idle(do)
62
391939f6 »
2011-07-22 basic grid implementation
63 gtk.main()
Something went wrong with that request. Please try again.