32 |
"win_toggle_shaded" : "win_toggle_shade" |
"win_toggle_shaded" : "win_toggle_shade" |
33 |
} |
} |
34 |
|
|
35 |
|
windows = [] |
36 |
|
gc = None |
37 |
|
border_color = None |
38 |
|
titlebar_color = None |
39 |
|
|
40 |
def load(self): |
def load(self): |
41 |
|
|
42 |
#white_color = self.display.screen().white_pixel |
screen = self.display.screen() |
|
#print white_color |
|
|
#gc = self.display.screen().root.create_gc() |
|
|
#print gc |
|
|
#self.display.screen().root.fill_rectangle(gc, 200, 200, 200, 200) |
|
|
#self.display.flush() |
|
|
#print self.display.screen().default_colormap.alloc_named_color('#00ff00') |
|
|
#for win in self.display.screen().root.query_tree().children: |
|
|
# for atom in win.list_properties(): |
|
|
# print self.display.get_atom_name(atom) |
|
|
# print "" |
|
|
# print win.get_wm_hints() |
|
|
# print "" |
|
|
# print win.get_wm_normal_hints() |
|
|
# print "" |
|
|
# print win.get_geometry().width |
|
|
# window = self.display.screen().root.create_window( |
|
|
# win.get_geometry().x, win.get_geometry().y, |
|
|
# win.get_geometry().width, win.get_geometry().height, |
|
|
# 2, self.display.screen().root_depth, |
|
|
# X.InputOutput) |
|
|
# window.map() |
|
|
# win.reparent(window, 0, 0) |
|
|
#win = self.display.screen().root.create_window(100, 100, 200, 200, 10, 16) |
|
|
#win.map() |
|
|
root = self.display.screen().root |
|
|
depth = self.display.screen().root_depth |
|
|
|
|
43 |
font = self.display.open_font("9x15") |
font = self.display.open_font("9x15") |
44 |
|
white_color = screen.white_pixel |
45 |
white_color = self.display.screen().white_pixel |
black_color = screen.black_pixel |
46 |
black_color = self.display.screen().black_pixel |
#overall_width = font.query_text_extents("Phoenix [nightly]").overall_width |
47 |
|
gc = screen.root.create_gc(background = white_color, |
|
overall_width = font.query_text_extents("Phoenix [nightly]").overall_width |
|
|
|
|
|
win1 = self.display.screen().root.create_window(80, 200, |
|
|
overall_width + 8, 200, 1, depth, |
|
|
X.InputOutput, |
|
|
X.CopyFromParent, |
|
|
background_pixel = white_color) |
|
|
|
|
|
win2 = win1.create_window(2, 2, overall_width + 2, 20, 1, depth, |
|
|
X.InputOutput, |
|
|
X.CopyFromParent, |
|
|
background_pixel = white_color) |
|
|
|
|
|
gc = win2.create_gc(background = white_color, |
|
48 |
forerground = black_color, |
forerground = black_color, |
49 |
font = font, |
font = font, |
50 |
event_mask = X.ExposureMask) |
event_mask = X.ExposureMask) |
51 |
|
|
52 |
|
for win in self.display.screen().root.query_tree().children: |
53 |
|
self.build_win(win) |
54 |
|
|
55 |
|
|
|
root.draw_text(gc, 300, 400, "Phoenix [nightly]") |
|
|
win2.draw_text(gc, 1, 1, "Phoenix [nightly]") |
|
|
win1.draw_text(gc, 1, 1, "Phoenix [nightly]") |
|
56 |
|
|
57 |
win1.fill_rectangle(gc, 1, 1, 100, 100) |
#win1 = self.display.screen().root.create_window(80, 200, |
58 |
win2.fill_rectangle(gc, 2, 2, 200, 200) |
# overall_width + 8, 200, 1, depth, |
59 |
|
# X.InputOutput, |
60 |
|
# X.CopyFromParent, |
61 |
|
# background_pixel = white_color) |
62 |
|
|
63 |
|
# |
64 |
|
#root.draw_text(gc, 300, 400, "Phoenix [nightly]") |
65 |
|
#win1.fill_rectangle(gc, 1, 1, 100, 100) |
66 |
#root.fill_rectangle(gc, 200, 200, 200, 200) |
#root.fill_rectangle(gc, 200, 200, 200, 200) |
67 |
|
#win1.map_sub_windows() |
|
win1.map_sub_windows() |
|
68 |
#win2.map_sub_windows() |
#win2.map_sub_windows() |
69 |
#win1.clear_area() |
#win1.clear_area() |
70 |
#win2.clear_area() |
#win2.clear_area() |
71 |
win1.map() |
#win1.map() |
72 |
win1.configure(x = 100, y = 100) |
#win1.configure(x = 100, y = 100) |
73 |
|
|
74 |
|
def build_win(self, appwin): |
75 |
|
#self.windows[0:0] = |
76 |
|
print "build_win" |
77 |
|
appwin_width = appwin.get_geometry().width |
78 |
|
appwin_height = appwin.get_geometry().height |
79 |
|
|
80 |
|
# This surrounds the app window |
81 |
|
frame = self.display.screen().root.create_window(0, 10, |
82 |
|
appwin_width, appwin_height, 1, self.display.screen().root_depth, |
83 |
|
X.InputOutput, |
84 |
|
X.CopyFromParent) |
85 |
|
frame.map() |
86 |
|
|
87 |
|
titlebar = self.display.screen().root.create_window(0, 0, |
88 |
|
appwin_width, 10, 1, self.display.screen().root_depth, |
89 |
|
X.CopyFromParent, X.CopyFromParent) |
90 |
|
titlebar.map() |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
appwin.reparent(frame, 0, 0) |
98 |
|
|
99 |
|
#titlebar = self.display.screen().root.create_window(80, 200, |
100 |
|
# 250, 200, 1, depth, |
101 |
|
# X.InputOutput, |
102 |
|
# X.CopyFromParent, |
103 |
|
# background_pixel = white_color) |
104 |
|
|
105 |
|
|
106 |
def move(self, event): |
def move(self, event): |
107 |
win.configure(x = dest_x, y = dest_y) |
win.configure(x = dest_x, y = dest_y) |