Re: Adventures in gtk-perl - tables and windows

Mike Martin <redtux1 gmail com> writes:



I cant find any way to get the X11 name from GDK,

$win->property_get, but it's a little icky :).  I forget what you're
supposed to pass for the length parameter.  I limit on how huge a chunk
you want to grab in one go, or something.

use strict;
use warnings;
use Gtk2 '-init';
my $s=Gtk2::Gdk::Screen->get_default or die print $!;

my $display = $s->get_display;
my $atom_string = Gtk2::Gdk::Atom->intern('STRING');
my $atom_wm_name = Gtk2::Gdk::Atom->intern('WM_NAME');

foreach my $w ($s->get_window_stack){
  my $xid=$w->get_xid;
  my $win = Gtk2::Gdk::Window->foreign_new_for_display ($display, $xid);

  my ($type_atom, $format, $data)
    = $win->property_get ($atom_wm_name, $atom_string, 0, 9999, 0);
  print "$data\n";

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