On Mon, 8 Oct 2001, Skip Montanaro wrote: > > Tom> Can someone port this do pygtk2? Is enough functions wrapped yet to > Tom> do this? > > >> from gtk import * > >> > >> def _on_expose(drawingarea, event): > >> # get the GdkWindow > >> window = event.window > >> > >> # get the GC > >> gc = window.new_gc() > >> > >> # create a green color > >> color = drawingarea.get_colormap().alloc(0x0000, 0xFFFF, 0x0000) > >> > >> # use this color for drawing > >> gc.foreground = color
Unfortunately, the GdkGC object in 1.99.x doesn't handle this shorthand for setting attributes like it did in 0.6.x -- this statement just sets an object attribute. The set_foreground() method should work instead. James. -- Email: [EMAIL PROTECTED] WWW: http://www.daa.com.au/~james/ _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk