multithreading - using threads and pyGST in a wx python app -


OK, so I'm writing an app that plays music with pyGST binding.

It is necessary to use the thread to handle the playback The Binding Library handles the most thread control for me, which is good (and which I had searched for from them).

Now, I do not fully understand this concept, so I'm curious for some references, but the way I understand it, I have to inform the app basically that it uses many threads Can do.

I gathered it from the Gistromer site, where they use this call:

  gtk.gdk.threads_init () gtk.main ()  According to 

, this app states that it can use multiple threads (more or less), where my impression comes on.

The background is now get it. I put those code in my code, and they work fine. Whenever my app tries, instead of crashing, the music plays. But something does not seem right.
I get this line from those examples, they use gtk for the whole GUI, but I want to use wxWidgets, so it feels incorrect to call the gtk function to do this.

Is there a wx equal to this? Or is it OK to use it, and will it still work on a cross platform?

In addition, I should know how to extract all these threads (which it does not do now) I see how it works again in the example using a gtk method, then From, looking for a wx equivalent

PS: I think this (or solution) may be related to the wx.App.MainLoop () function, but I am trying to understand that How this loop works, again, good reference will be appreciated, but Areas that until not necessary as long as I have a good solution. Instead of:

  import gobject gobject.threads_init () 

I wonder how this is not written at the beginning of every dragon gstreamer plugin in the big dragon piece of documentation: it took me several hours to find it.

Some more details.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -