Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old November 15, 2009, 22:00   #1
fph
Knight
 
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 915
fph is on a distinguished road
Linux Window positioning

Is there a way to have Angband (on Linux) save and restore the position of its subwindows (term-n)? At least on the X11 port with GNOME/Ubuntu 9.10, this does not seem to happen.
Maybe it's a window-manager issue, but metacity does not seem to provide this ability, and I know this is handled explicitly in angband.ini in Windows.

Thanks,
fph is offline   Reply With Quote
Old November 15, 2009, 22:02   #2
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Quote:
Originally Posted by fph View Post
Is there a way to have Angband (on Linux) save and restore the position of its subwindows (term-n)? At least on the X11 port with GNOME/Ubuntu 9.10, this does not seem to happen.
Maybe it's a window-manager issue, but metacity does not seem to provide this ability, and I know this is handled explicitly in angband.ini in Windows.

Thanks,
Yes, there is. There's a script file embedded in comments in the source code, which lets you specify the position, size and font for each subwindow on X11. I think it's in main-x11.c ... <goes off to check>.

Yes, here it is:
Code:
 * #!/bin/csh
 *
 * # Describe attempt
 * echo "Launching angband..."
 * sleep 2
 *
 * # Main window
 * setenv ANGBAND_X11_FONT_0 10x20
 * setenv ANGBAND_X11_AT_X_0 5
 * setenv ANGBAND_X11_AT_Y_0 510
 *
 * # Message window
 * setenv ANGBAND_X11_FONT_1 8x13
 * setenv ANGBAND_X11_AT_X_1 5
 * setenv ANGBAND_X11_AT_Y_1 22
 * setenv ANGBAND_X11_ROWS_1 35
 *
 * # Inventory window
 * setenv ANGBAND_X11_FONT_2 8x13
 * setenv ANGBAND_X11_AT_X_2 635
 * setenv ANGBAND_X11_AT_Y_2 182
 * setenv ANGBAND_X11_ROWS_2 23
 *
 * # Equipment window
 * setenv ANGBAND_X11_FONT_3 8x13
 * setenv ANGBAND_X11_AT_X_3 635
 * setenv ANGBAND_X11_AT_Y_3 22
 * setenv ANGBAND_X11_ROWS_3 12
 *
 * # Monster recall window
 * setenv ANGBAND_X11_FONT_4 6x13
 * setenv ANGBAND_X11_AT_X_4 817
 * setenv ANGBAND_X11_AT_Y_4 847
 * setenv ANGBAND_X11_COLS_4 76
 * setenv ANGBAND_X11_ROWS_4 11
 *
 * # Object recall window
 * setenv ANGBAND_X11_FONT_5 6x13
 * setenv ANGBAND_X11_AT_X_5 817
 * setenv ANGBAND_X11_AT_Y_5 520
 * setenv ANGBAND_X11_COLS_5 76
 * setenv ANGBAND_X11_ROWS_5 24
 *
 * # The build directory
 * cd ~/Angband
 *
 * # Gamma correction
 * setenv ANGBAND_X11_GAMMA 142
 *
 * # Launch Angband
 * ./src/angband -mx11 -- -n6 &
Obviously you'll need to remove the asterisks, and you'll also need to convert it to your favourite shell. If you use bash, you need export instead of setenv.

You can add stanzas for subwindows 6 and 7, of course - and change all the values.
Magnate is offline   Reply With Quote
Old November 15, 2009, 22:31   #3
d_m
Angband Devteam member
 
d_m's Avatar
 
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 40
Posts: 1,516
d_m is on a distinguished road
Maybe we should add a contrib/ directory and put this script in it.
__________________
linux->xterm->screen->pmacs
d_m is offline   Reply With Quote
Old November 15, 2009, 23:08   #4
fph
Knight
 
Join Date: Apr 2009
Location: Pisa / DL0
Posts: 915
fph is on a distinguished road
Thanks a lot!

Code:
 * echo "Launching angband..."
 * sleep 2
Sleep 2? Uhm... for better responsivity, I guess?
fph is offline   Reply With Quote
Old November 16, 2009, 13:19   #5
pav
Administrator
 
pav's Avatar
 
Join Date: Apr 2007
Location: Prague, Czech republic
Age: 40
Posts: 783
pav is on a distinguished road
Send a message via ICQ to pav
Place something like this in your ~/.angband/Angband/x11-settings.prf -- it's a bit easier than a shell script wrapper.

Code:
# Angband X11 settings

TERM_WINS=4

# Term 0
AT_X_0=0
AT_Y_0=0
COLS_0=220
ROWS_0=74
IBOX_0=1
IBOY_0=1
FONT_0=8x13
TILE_WIDTH_0=8
TILE_HEIGHT_0=13

AT_X_1=0
AT_Y_1=1000
ROWS_1=14
FONT_1=8x13

AT_X_2=650
AT_Y_2=1000
ROWS_2=14
FONT_2=8x13

AT_X_3=1300
AT_Y_3=1000
COLS_3=60
ROWS_3=14
FONT_3=8x13
__________________
See the elves and everything! http://angband.oook.cz
pav is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphics issue - Gervais tiles & window menus maboleth Vanilla 6 September 16, 2009 03:40
1599: racial attributes not shown in character window Slow Development 0 August 7, 2009 09:03
Window menus. Utility and difference in different port versions. PaulBlay Vanilla 7 May 20, 2009 15:33
Window Preferences File? Dubtrain Vanilla 3 April 9, 2009 04:55
Dungeon window size Bodkin Vanilla 2 March 30, 2008 04:48


All times are GMT +1. The time now is 09:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.