Re: segfault using extension events in Gtk2's

gvb <postdoc38 yahoo fr>:
Here is a C code that enables the extended devices (then fires up the
InputDialog to check they are enabled):


I tried translating it like this

my $display=$window->get_display;
my @list=($display->list_devices());
for(my $i=0;$i<$#list;$i++){
  my $name=$list[$i]->name;
  my $result=$list[$i]->set_mode('GDK_MODE_SCREEN');
  print "activating device \# $i, name=$name result=$result\n";

but I guess I am missing the equivalent of the "tmp_list->data". Any idea?

The Perl code does seem to be equivalent to the C code.  In the C code "tmp_list->data" is the i-th GdkDevice 
object, i.e., $list[$i] in your Perl code.

What's not working with the Perl version?  Do you still get a segfault?  If so, try to get a backtrace with 

  $ gdb --args perl
  (gdb) r
  (gdb) bt

If the backtrace doesn't seem to make sense, try to use valgrind's memcheck:

  $ valgrind perl

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