LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2007, 01:05 AM   #1
tinieprotonjam
LQ Newbie
 
Registered: Dec 2006
Posts: 28

Rep: Reputation: 15
Question is there a piece of c code that can set the terminal window


I was just wondering if there is a piece of code in C that I can put in my program so that when I run the executable file, it will instantly set the size of the terminal window to a specific size, so that I can format the layout of the display on the window. thanks.
 
Old 01-27-2007, 02:39 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
There is no standard way AFAIK. However, some terminal emulators allow control using DCOP and similar tools. For example, the KDE terminal emulator, konsole, may be resized by making a function call via dcop like this (example is using command-line dcop tool, but there's a C API to make dcop calls).
Code:
dcop konsole-4695 konsole-mainwindow#1 setSize 800x600
The -4695 is the PID of the konsole instance in question.
 
Old 01-27-2007, 07:20 AM   #3
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
Hi.

I don't do X Window programming, but if I really wanted to do something like that, I'd start with a look at:
Quote:
Depending on the valuemask, the XChangeWindowAttributes function uses
the window attributes in the XSetWindowAttributes structure to change
the specified window attributes. -- excerpt from man XChangeWindowAttributes
I would guess that this could become very complex very quickly.

Best wishes ... cheers, makyo
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
building shell command piece by piece aunquarra Linux - General 7 05-02-2006 06:43 AM
Unusual piece of bash script code raypen Slackware 2 03-18-2006 10:49 PM
set terminal window wdith allelopath Linux - General 2 04-16-2005 06:06 PM
Terminal Code CyclopsLiteraly Linux - Software 4 06-10-2004 05:04 PM
nice piece of code ....HOW DOES IT WORK? deadhead Programming 7 12-07-2003 12:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration