+ -
当前位置:首页 → 问答吧 → 用QT写的贪食蛇游戏

用QT写的贪食蛇游戏

时间:2011-11-07

来源:互联网

谁会找的。任何语言都可以。

代码:
● xwininfo -tree -root|grep -C 6 desktop
           0x2c005b5 (has no name): ()  950x2+9+0  +902+355
           0x2c005b4 (has no name): ()  23x44+0+0  +893+355
     0x1600111 (has no name): ()  1920x1080+0+0  +0+0
        1 child:
        0x1600112 (has no name): ()  1920x1080+0+0  +0+0
           1 child:
           0x1c00004 "桌面": ("desktop_window" "Nautilus")  1920x1080+0+0  +0+0
              2 children:
              0x1c00072 (has no name): ()  1920x1080+0+0  +0+0
              0x1c00005 (has no name): ()  1x1+-1+-1  +-1+-1
     0x1200003 "main.py": ("main.py" "Main.py")  24x14+1876+1026  +1876+1026
        1 child:
        0x1200004 (has no name): ()  1x1+-1+-1  +1875+1025


代码:
● dog drawonroot.pl

sub wininfo{
my $w=shift;
my ($x, $y, $width, $height, $depth) = $w->get_geometry;
printf "%10x:\t${width}x$height+$x+$y\@$depth\ttype:%s\n", $w->get_xid, $w->get_type_hint;
}
Gtk2->init;
$window=Gtk2::Gdk->get_default_root_window;
($drawable,$x_offset,$y_offset)=$window->get_internal_paint_info;
wininfo($window);
@wlist = $window->get_children;
foreach(@wlist){ wininfo($_); }
wininfo($_);
exit;

只得到
代码:
● drawonroot.pl
       15d:   1920x1080+0+0@24   type:normal
   3c00001:   10x10+10+10@24   type:normal
    a0000a:   10x10+0+0@24   type:normal

而3c00001 a0000a 在 xwininfo -tree -root里面根本没有。
就算直接从xwininfo的结果得到 0x1c00004,怎么指定此窗口?
$_=Gtk2::Gdk::Window->lookup(0x1c00004); 可不行。

作者: eexpress   发布时间: 2011-11-07

热门下载

更多