Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-28 Thread Benjamin Berg
On Wed, 2012-06-27 at 13:50 -0300, Manuel Kaufmann wrote: I'm not completely sure what I did :P , but I have Implode working under Gtk3 now :) This is the diff: http://bugs.sugarlabs.org/attachment/ticket/3715/First-Working-Version.diff It looks to me like the change could be that you are

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-28 Thread Gonzalo Odiard
A few notes/questions: * The deleted lines defining signals as 'override' are not needed anymore? * self.set_flags(Gtk.CAN_FOCUS) is self.set_can_focus() in gtk3 * gtk.gdk.BUTTON_PRESS_MASK and friends are Gdk.EventMask.BUTTON_PRESS_MASK in gtk3 * Is needed the clip in _draw_event_cb? * The

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-28 Thread Manuel Kaufmann
On Thu, Jun 28, 2012 at 8:06 AM, Gonzalo Odiard gonz...@laptop.org wrote: * The deleted lines defining signals as 'override' are not needed anymore? I think they are not needed. 'override' is to make something extra with that signal (at least, that is what I understood) but there are no methods

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-28 Thread Manuel Kaufmann
On Thu, Jun 28, 2012 at 5:23 AM, Benjamin Berg ben...@sugarlabs.org wrote: It looks to me like the change could be that you are now connecting to the draw signal, instead of overriding do_draw(self, cr). Though I can't think of a reason for do_draw() not to work currently. I feel more

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-28 Thread Benjamin Berg
On Thu, 2012-06-28 at 08:22 -0300, Manuel Kaufmann wrote: ie.: clipped, rect = Gdk.cairo_get_clip_rectangle(cr) clipped will always be True in GTK+. rect then contains the affected area, similar to event.area before. So, I should ask for the affected rect and use it to re-draw just

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-28 Thread Manuel Kaufmann
On Thu, Jun 28, 2012 at 8:36 AM, Benjamin Berg ben...@sugarlabs.org wrote: def do_draw(self, cr):    alloc = self.get_allocation()    self._current_drawer.draw(cr, alloc.width, alloc.height) Nothing else is required. Excelente! It works properly! Thanks :) -- Kaufmann Manuel Blog:

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-27 Thread Gonzalo Odiard
Maybe this (ported to gtk3) can be useful for you http://git.sugarlabs.org/simplepiano Gonzalo On Wed, Jun 27, 2012 at 12:07 PM, Manuel Kaufmann humi...@gmail.com wrote: Hello, I'm porting Implode to Gtk3 and after doing some changes I found that I can't draw the main widget: GridWidget

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-27 Thread Manuel Kaufmann
On Wed, Jun 27, 2012 at 12:13 PM, Gonzalo Odiard gonz...@laptop.org wrote: Maybe this  (ported to gtk3) can be useful for you I was taking a look at that. The problem that I think that I'm having is that the draw signal is not emitted by Gtk and I don't know why. If I put a logging.debug in the

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-27 Thread Manuel Quiñones
2012/6/27 Manuel Kaufmann humi...@gmail.com: On Wed, Jun 27, 2012 at 12:13 PM, Gonzalo Odiard gonz...@laptop.org wrote: Maybe this  (ported to gtk3) can be useful for you I was taking a look at that. The problem that I think that I'm having is that the draw signal is not emitted by Gtk and I

Re: [Sugar-devel] Gtk.DrawingArea's draw signal

2012-06-27 Thread Manuel Kaufmann
On Wed, Jun 27, 2012 at 1:40 PM, Manuel Quiñones ma...@laptop.org wrote: What if you force sending the signal? call queue_draw() http://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-queue-draw Yes, I had already tried that but I couldn't. I'm not completely sure what I did :P ,