Re: Get mouse events in Gtk::Window

On Sun, 8 Jul 2012 22:15:30 -0400
Paul Martin <ukrcamilio gmail com> wrote:

Hello I am writing an application in which I have MPlayer embedded in a
window. I am trying to retrieve mouse events from the window. I have tried
to set_events("button-press-mask") on the embedded element, but that did
not allow me to see button-press-events. What am I doing wrong?

Hi, I have tried it in the past with no success with mplayer.

You could try adding this to the gdkwindow,  $window->window

# this dosn't work and loses pointer globally
my $rc;
$rc = 
    warn "pointer grab failed ($rc)\n" unless $rc eq 'success';
$rc = Gtk2::Gdk->keyboard_grab($gdkwindow,0,Gtk2->get_current_event_time);
    warn "keyboard grab failed ($rc)\n" unless $rc eq 'success';

You might need to use the Socket-Plug methods, but I never could figure that out.

It would help if you posted a simple code example to show how you load mplayer.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]