🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #10594

Re: Resizing current window

#10594
From: Perry Cross
Date: Sat, 28 Jan 1989 08:15
46 lines
1694 bytes
Sorry this is dated, but I fell behind reading.  Someone wanted to resize
his current window programmatically but I only saw the answers, not the
request, hence I'm sending to Sunspots and not the requestor.

	Perry

/*  Program to resize current shelltool to 100 x 100 pixels
    cc <filename> -lsuntool -lsunwindow -lpixrect

    Of course you could just do the following:

	#include <stdio.h>

	static char ESC = '\033';

	main()
	{
        	printf("%c[4;%d;%dt", ESC, 100, 100);
	}

/*
#include <stdio.h>
#include <suntool/sunview.h>
#include <pixrect/pixrect.h>
#include <sunwindow/window_hs.h>
#include <sys/file.h>

main(argc,argv)
int argc;
char *argv[];
{
        Rect this_rect;
        char *this_window = (char *)getenv("WINDOW_ME"), parent[WIN_NAMESIZE];
        int fd;

	/*  WINDOW_ME is the tty, you want the parent */
        fd = open(this_window, O_RDWR);
        win_numbertoname(win_getlink(fd, WL_PARENT), parent); close(fd);
        fd = open(parent, O_RDWR); 
        win_getrect(fd, &this_rect);   
        this_rect.r_width = this_rect.r_height = 100;
        win_setrect(fd, &this_rect);
        close(fd);

        exit(0);
}
Technical Details
Message-ID: <8901210159.AA14900@wheelie.sun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: perryc@sun.com (Perry Cross)
Newsgroups: comp.sys.sun
Subject: Re: Resizing current window
Message-ID: <8901210159.AA14900@wheelie.sun.com>
Date: 28 Jan 89 08:15:45 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 46
Approved: Sun-Spots@rice.edu
Original-Date: Fri, 20 Jan 89 17:59:16 PST
X-Sun-Spots-Digest: Volume 7, Issue 126, message 10 of 12
X-Issue-Reference: v7n82