in reply to Glib & Wx interoperation

How can I integrate functions from Gtk in wxPerl?

Replies are listed 'Best First'.
Re^2: Glib & Wx interoperation
by Steve_BZ (Chaplain) on Jun 22, 2011 at 12:21 UTC

    Hi Anon,

    Well I'm a little embarrassed that you pointed me to a post I made myself in 2009, however, I never got that working either. Instead I managed to get Wx::MediaCtrl working as it should. However, I'm still left with three major Wx::MediaCtrl problems on Linux (doesn`t happen on Windows),

    1. Playback crashes at the end of the file;
    2. Segfault on load of a second file;
    3. I can't play a live feed;

    On reflection, something I should do more of, maybe I should try fix the bugs in GStreamerMediaBackend.cpp. This would get Wx::MediaCtrl working and help to maintain wxWidgets and wxPerl.

    So if anyone knows how to tie wxPerl and Gtk2 together, I'm still *really* interested. However, I shall now devote some time to GStreamerMediaBackend.cpp.

    Regards

    Steve

      Its a two parter

      Part one, obtain gstreamer-window-id, then setparent for gstreamer-window-id to your-tk-wx-window-id, Perl/Tk front-end to mplayer shows one way, another is wxWindow::GetHandle +

      my $player = Win32::GuiTest::FindWindowLike... my $SetParent = Win32::API::->new("user32","SetParent","NN","N") $SetParent->( $player, $frame->GetHandle )
      There are equivalent api calls for linux , its probably easier in C-code

      Part two is event loop interaction. You create your own MainLoop which is

      while(1){ $glib->DoOneEvent; $wxapp->Dispatch; }
      POE::..LOOP.. might help with this, at least for finding the equivalent of DoOneEvent :)

      Alternate loop strategy, each event loop is run in separate thread (require Wx; ...) as normal (MainLoop)

      Alternate approach, start working on wxGStreamer , based on GStreamer .... fixing the problems with wxMediaCtrl is probably less work :)