0

I have a gtk.Fixed. I move components inside it around using:

myFixed.move( myEventBox, new_x, new_y )

What event do I listen for to know when myEventBox has been rendered at its new position?

Do I connect to the fixed or the eventbox?

MORE INFO:

I need this information so I know when it is safe to queue a video under the eventbox... if I do it too soon (e.g. right after calling myFixed.move) I can see the glitch. Currently getting around this with a gobject.idle_add.

jedierikb
  • 12,752
  • 22
  • 95
  • 166

1 Answers1

1

To be honest, I am not aware of any such event. The object should move immediately and redraw the screen, but I don't think any signal is emitted when that happens.

The PyGTK documentation is very comprehensive, and it will list all of the functions and events of every object in the library. In searching (through both the gtk.Container (for fixed) and gtk.Widget (for fixed and eventbox) signal lists, I can't find any such event. The closest thing is an "add" signal in gtk.Container, but I don't think that's what you're looking for.

If the object is not moving, please post your code, because there is probably a subtle error.

If the object is moving just fine and you just want the event/signal, you may have to simulate it yourself. Write the function you want to be called as soon as the object is moved in a function (def) inside "__ init __", and then call that function in code in the line right after "myFixed.move".

CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
  • The eventbox is moving, the issue is knowing when it has been moved so that I can move the next eventbox in a stack hiding beneath it... (explanation added to op.). I guess I need something like a "next frame" event... – jedierikb Sep 15 '11 at 22:12
  • Again, yes, just call the line of code you need after you move the object. :D – CodeMouse92 Sep 15 '11 at 22:19
  • Yeah, that doesn't work... I move the box over a video, I play a video 'under' the box on the next line, and you see a video glitch. If I idle_add then play video -- no glitch. In the former case the box is not in place yet. – jedierikb Sep 15 '11 at 23:02
  • I think that has to do with a glitch in the video player. I don't think an event would help you here... – CodeMouse92 Sep 15 '11 at 23:28
  • Let me phrase "glitch" differently --> you can see gstreamer's xvimagesink's chroma field (a black field) before the video starts playing (NULL to READY) on very, very slow machines. If you cover xvimagesink with an eventbox or window, you do not see this field of black. My "hide until ready" strategy works, but it involves starting the video once the video is obfuscated (e.g. the eventbox is over the video). Unfortunately, calling move() \n playVideo() results in the playVideo command running first. move() is not instant. – jedierikb Sep 16 '11 at 12:06