Features/GTK3/Porting/Typing Turtle: Difference between revisions
No edit summary |
|||
| Line 19: | Line 19: | ||
self.area.window.draw_rectangle(gc, True, x, y, w, h) | self.area.window.draw_rectangle(gc, True, x, y, w, h) | ||
The arguments for ''alloc_color'' are between 1 | The arguments for ''alloc_color'' are between 0-65535 and the ''set_source_rgb'' method from cairo are between 0-1, so we have to convert these values as well: | ||
cr.set_source_rgb(0.762, 0.762, 0.762) | cr.set_source_rgb(0.762, 0.762, 0.762) | ||
| Line 27: | Line 25: | ||
cr.fill() | cr.fill() | ||
Note that the second attributo of ''draw_rectangle'' tells us about if the rectangle is filled or not. In this case is True, so we use ''cr.fill()'' in the new way but if we want just the outside lines of the rectangle we should use ''cr.stroke()'' | |||
= Code Snippets = | = Code Snippets = | ||