Re: iconize a window

Pavel Rousnak <pr rpb ru> wrote:

I don't know how to do this with Perl.
I had the problem like this and didn't find anything better than
low-level Xlib function XIconifyWindow:

    private = (GdkWindowPrivate*)widget->window;
    if (!private->destroyed)
        XIconifyWindow(private->xdisplay, private->xwindow, 0);

I glued this Xlib function to Perl using Inline C:


use Inline C => 'DATA' => 
INC => `gtk-config --cflags`,
LIBS => `gtk-config --libs`;

use Gtk;
init Gtk;

$window = new Gtk::Window();

$button = new Gtk::Button('minimize');
$button->signal_connect('clicked', sub {
        iconify($window->window->XDISPLAY(), $window->window->XWINDOW());



main Gtk;


void iconify(int xdisplay, int xwindow) {
        XIconifyWindow(xdisplay, xwindow, 0);


Jens Luedicke
jens irs-net com

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