/[circus]/circus/modules/CircusFrame/frame.py
ViewVC logotype

Diff of /circus/modules/CircusFrame/frame.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by tvon, Tue Nov 19 04:30:37 2002 UTC revision 1.3 by tvon, Thu Nov 21 02:50:15 2002 UTC
# Line 27  class MyModule(module.Module): Line 27  class MyModule(module.Module):
27    
28      my_actions = {      my_actions = {
29          "win_move" : "move",          "win_move" : "move",
30          "win_toggle_maximize" : "win_toggle_maximize",          "win_toggle_iconified" : "win_toggle_maximize",
31          "win_toggle_shade" : "win_toggle_shade"          "win_toggle_maximized" : "win_toggle_maximize",
32            "win_toggle_shaded" : "win_toggle_shade"
33          }          }
34    
35      def load(self):      def load(self):
36            
37          #white_color = self.display.screen().white_pixel          #white_color = self.display.screen().white_pixel
38          #print white_color          #print white_color
39          #gc = self.display.screen().root.create_gc()          #gc = self.display.screen().root.create_gc()
# Line 39  class MyModule(module.Module): Line 41  class MyModule(module.Module):
41          #self.display.screen().root.fill_rectangle(gc, 200, 200, 200, 200)          #self.display.screen().root.fill_rectangle(gc, 200, 200, 200, 200)
42          #self.display.flush()          #self.display.flush()
43          #print self.display.screen().default_colormap.alloc_named_color('#00ff00')          #print self.display.screen().default_colormap.alloc_named_color('#00ff00')
44          for win in self.display.screen().root.query_tree().children:          #for win in self.display.screen().root.query_tree().children:
45              for atom in win.list_properties():          #    for atom in win.list_properties():
46                  print self.display.get_atom_name(atom)          #        print self.display.get_atom_name(atom)
47              print ""          #    print ""
48              print win.get_wm_hints()          #    print win.get_wm_hints()
49              print ""          #    print ""
50              print win.get_wm_normal_hints()          #    print win.get_wm_normal_hints()
51              print ""          #    print ""
52              print win.get_geometry().width          #    print win.get_geometry().width
53              window = self.display.screen().root.create_window(          #    window = self.display.screen().root.create_window(
54                  win.get_geometry().x, win.get_geometry().y,          #        win.get_geometry().x, win.get_geometry().y,
55                  win.get_geometry().width, win.get_geometry().height,          #        win.get_geometry().width, win.get_geometry().height,
56                  2, self.display.screen().root_depth,          #        2, self.display.screen().root_depth,
57                  X.InputOutput)          #        X.InputOutput)
58              window.map()          #    window.map()
59              win.reparent(window, 0, 0)          #    win.reparent(window, 0, 0)
60          #win = self.display.screen().root.create_window(100, 100, 200, 200, 10, 16)          #win = self.display.screen().root.create_window(100, 100, 200, 200, 10, 16)
61          #win.map()          #win.map()
62            root = self.display.screen().root
63            depth = self.display.screen().root_depth
64    
65            font = self.display.open_font("9x15")
66            
67            white_color = self.display.screen().white_pixel
68            black_color = self.display.screen().black_pixel
69            
70            overall_width = font.query_text_extents("Phoenix [nightly]").overall_width
71            
72            win1 = self.display.screen().root.create_window(80, 200,
73                overall_width + 8, 200, 1, depth,
74                X.InputOutput,
75                X.CopyFromParent,
76                background_pixel = white_color)
77    
78            win2 = win1.create_window(2, 2, overall_width + 2, 20, 1, depth,
79                X.InputOutput,
80                X.CopyFromParent,
81                background_pixel = white_color)
82    
83            gc = win2.create_gc(background = white_color,
84                forerground = black_color,
85                font = font,
86                event_mask = X.ExposureMask)
87    
88            root.draw_text(gc, 300, 400, "Phoenix [nightly]")
89            win2.draw_text(gc, 1, 1, "Phoenix [nightly]")
90            win1.draw_text(gc, 1, 1, "Phoenix [nightly]")
91            
92            win1.fill_rectangle(gc, 1, 1, 100, 100)
93            win2.fill_rectangle(gc, 2, 2, 200, 200)
94    
95            #root.fill_rectangle(gc, 200, 200, 200, 200)
96    
97            win1.map_sub_windows()
98            #win2.map_sub_windows()
99            #win1.clear_area()
100            #win2.clear_area()
101            win1.map()
102            win1.configure(x = 100, y = 100)
103            
104            
105      def move(self, event):      def move(self, event):
106          win.configure(x = dest_x, y = dest_y)          win.configure(x = dest_x, y = dest_y)
107                    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26