1 2 3 4 5 6 7 8 9 10 11
| self.drw_Map = self.frm_Main.get_widget("drw_Map")
self.drw_Map.set_size_request(self.drw_Map_width, self.drw_Map_height)
self.drw_Map_window = self.drw_Map.window
self.pangolayout = self.drw_Map.create_pango_layout("")
self.color_list = ["#FFFFFF", "#FF0000", "#00FF00", "#0000FF"]
self.colors = {}
self.gc = {}
for color in self.color_list:
self.colors[color] = self.drw_Map.get_colormap().alloc_color(color)
self.gc[color] = self.drw_Map_window.new_gc(foreground = self.colors[color], line_width = 2)
self.drw_Map_window.draw_rectangle(self.gc[self.color], 0, x, y, w, h) |
Partager