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 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: http://humitos.wordpress

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-

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 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 comfortable by connect

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 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 associated to thos

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 Gdk.

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 a

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 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 , but I have Implo

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

2012-06-27 Thread Manuel Quiñones
2012/6/27 Manuel Kaufmann : > On Wed, Jun 27, 2012 at 12:13 PM, Gonzalo Odiard 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

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 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 method "do_draw_

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 wrote: > Hello, > > I'm porting Implode to Gtk3 and after doing some changes I found that > I can't draw the main widget: GridWidget (inherits from