Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 28 Nov 2014, 14:11
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Xcalc problem solved, Xcalc problem created
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
Wosh


Joined: 09 Jul 2007
Posts: 60
Location: Nuremberg Germany

PostPosted: Fri 18 Jan 2008, 19:59    Post subject:  Xcalc problem solved, Xcalc problem created
Subject description: Solved: xcalc using decimal different from "period". Solved!!!: Different look for xcalc.
 

Am I the first non-native English person trying to use decimal calculations with xcalc?

The decimal separator for English people is the period ".". For other countries like the locale de_DE the decimal separator is the comma ",".

If those people call xcalc preinstalled in Puppy 3.01 the following behaviour can be watched:
Entering '3' '.' '4' displays "3.4".
Adding '2' '.' '8' displays "2.8" and results in "5".
Divding '5' '/' '4' results in "1,25".
Entering '3' ',' '4' displays "3".

So obviously the preinstalled xcalc uses the decimal comma for results, but it does not allow to enter the comma as decimal separator.

A look at the modification time of xcalc shows June 14 2004.

So assuming maybe this version is a bit outdated I did the following steps:
1. Download the sources xcalc-1.0.1.tar.bz2 from the mirror t2/source/6.0/x.
2. Run confgure and make from devx_301.sfs.
3. The linker complains about the missing library Xaw7.
4. After patching the library Xaw7 to Xaw8 within the Makefile "make" builds xcalc.

Calling the new xcalc version the following valid behaviour can be watched :
Entering '3' '.' '4' displays "3,4".
Adding '2' '.' '8' displays "2,8" and results in "6,2".

Adding the two lines to the resource file /usr/X11R7/lib/X11/app-defaults/Xcalc after

XCalc*ti.bevel.screen.LCD.translations: #replace\n\

:<Key>\\,:decimal()\n\
<Key>Return:equal()\n\

makes it possible to enter the comma as decimal separator and to use the RETURN-key to calculate the result (default is ENTER or '=' only).

So even if xcalc now can be used in localized Puppy versions the look has changed.
At the left you can see the preinstalled xcalc with the invalid decimal point and a three dimensional look of the buttons.
At the right is the new compiled xcalc with the decimal comma, a rather basic look and a little bit longer.
Both programs use /usr/X11R7/lib/X11/app-defaults/Xcalc as resource.

I am not an X11-expert at all. So maybe some experienced user can answer my two questions:

1. What leads to that different look of my xcalc?
2. What does the warning mean "Cannot convert string "calculator" to type Pixmap" if any of these two versions is called from a console?
xcalc-decimal.png
 Description   
 Filesize   15.98 KB
 Viewed   808 Time(s)

xcalc-decimal.png


_________________
Wosh

Last edited by Wosh on Fri 18 Jan 2008, 20:40; edited 2 times in total
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 18 Jan 2008, 20:11    Post subject:  

I think it was compiled with libXaw95.
That is a library that was used by the windowmanager Fvwm95, that tried to mimic Win95 look. It was used in early versions of Puppy.
libXaw95.so should be in /usr/X11R7/lib

Mark
Back to top
View user's profile Send private message Visit poster's website 
Wosh


Joined: 09 Jul 2007
Posts: 60
Location: Nuremberg Germany

PostPosted: Fri 18 Jan 2008, 20:35    Post subject: The reason is libXaw95
Subject description: Download localisized xcalc
 

Thanks Mark

I have replaced Xaw7 with Xaw95 within the xcalc Makefile and now xcalc has the same look as the preinstalled one.
So maybe Barry will take pity on the not English speaking world and recompile xcalc.

If not, here is the localisized xcalc compiled with Xaw95:
xcalc.zip
Description 
zip

 Download 
Filename  xcalc.zip 
Filesize  9.87 KB 
Downloaded  314 Time(s) 
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 18 Jan 2008, 21:04    Post subject:  

thank you, I will add it to the next german Muppy Smile
Could you also upload the white one?
Some people might prefer that.
Mark
Back to top
View user's profile Send private message Visit poster's website 
Wosh


Joined: 09 Jul 2007
Posts: 60
Location: Nuremberg Germany

PostPosted: Sat 19 Jan 2008, 15:38    Post subject:  Localisized xcalc in both forms
Subject description: Use what you want.
 

Hello Mark, hello world

Working on this topic I have become curious.
Maybe some experienced X11 programmer still can answer what the warning means "Cannot convert string "calculator" to type Pixmap"?

It's a reference to the third line in Xcalc:
XCalc.IconPixmap: calculator

I have created a small bzip2-tar-archive xcalc-local.tar.bz2 containing:
1. XCalc.............. modified resource-file
2. Xaw95/xcalc localisized xcalc with the look in Puppy 3.01
3. Xaw8/xcalc.. localisized xcalc with the previous basic look

All you must do:
Copy XCalc to /usr/X11R7/lib/X11/app-defaults
Copy xcalc to /usr/X11R7bin

I hope you enjoy calculations.
xcalc-local.tar.bz2
Description 
bz2

 Download 
Filename  xcalc-local.tar.bz2 
Filesize  14.72 KB 
Downloaded  309 Time(s) 

_________________
Wosh
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Sat 19 Jan 2008, 17:00    Post subject:  

Danke Wosh Smile
Mark
Back to top
View user's profile Send private message Visit poster's website 
goingnuts

Joined: 07 Dec 2008
Posts: 783

PostPosted: Mon 10 Feb 2014, 14:56    Post subject:  

The "Warning: Cannot convert string "calculator" to type Pixmap" can be removed by having file "/usr/X11R7/include/X11/bitmaps/calculator" present

It seems to do nothing. I was hoping to have a window icon - but the "X-window-icon" sticks.

How to change the window icon for these old Xaw applications?
Edit: To change jwm-window icon supply an icon in /usr/share/pixmaps with the name "xcalc.xpm" or "xcalc.png".

Content of /usr/X11R7/include/X11/bitmaps/calculator:
Code:
#define icon_width 28
#define icon_height 48
static char icon_bits[] = {
   0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, 0x03, 0x00, 0x00, 0x0c,
   0xd3, 0x5d, 0x5d, 0x0c, 0x13, 0x51, 0x45, 0x0c, 0xd3, 0xdd, 0xdd, 0x0d,
   0x53, 0x10, 0x51, 0x0d, 0xd3, 0x1d, 0xdd, 0x0d, 0x03, 0x00, 0x00, 0x0c,
   0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x08,
   0xbd, 0xf7, 0xde, 0x0b, 0xbd, 0xf7, 0xde, 0x0b, 0x01, 0x00, 0x00, 0x08,
   0xbd, 0xf7, 0xde, 0x0b, 0xa5, 0x94, 0x52, 0x0a, 0xbd, 0xf7, 0xde, 0x0b,
   0x01, 0x00, 0x00, 0x08, 0xbd, 0xf7, 0xde, 0x0b, 0xbd, 0xf7, 0xde, 0x0b,
   0xbd, 0xf7, 0xde, 0x0b, 0x01, 0x00, 0x00, 0x08, 0xbd, 0xf7, 0xde, 0x0b,
   0xbd, 0xf7, 0xde, 0x0b, 0xbd, 0xf7, 0xde, 0x0b, 0x01, 0x00, 0x00, 0x08,
   0xbd, 0xf7, 0xde, 0x0b, 0xbd, 0x94, 0xd2, 0x0b, 0xbd, 0x94, 0xd2, 0x0b,
   0xbd, 0xf7, 0xde, 0x0b, 0x01, 0x00, 0x00, 0x08, 0xbd, 0xf7, 0xde, 0x0b,
   0xbd, 0x94, 0xd2, 0x0b, 0xbd, 0x94, 0xd2, 0x0b, 0xbd, 0xf7, 0xde, 0x0b,
   0x01, 0x00, 0x00, 0x08, 0xbd, 0xf7, 0xde, 0x0b, 0xbd, 0x94, 0xd2, 0x0b,
   0xbd, 0x94, 0xd2, 0x0b, 0xbd, 0xf7, 0xde, 0x0b, 0x01, 0x00, 0x00, 0x08,
   0xbd, 0xff, 0xde, 0x0b, 0xbd, 0x80, 0xd2, 0x0b, 0xbd, 0x80, 0xd2, 0x0b,
   0xbd, 0xff, 0xde, 0x0b, 0x01, 0x00, 0x00, 0x08, 0xff, 0xff, 0xff, 0x0f};
Back to top
View user's profile Send private message Visit poster's website 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Sat 15 Feb 2014, 15:55    Post subject:  

goingnuts wrote:
How to change the window icon for these old Xaw applications?
Edit: To change jwm-window icon supply an icon in /usr/share/pixmaps with the name "xcalc.xpm" or "xcalc.png".

OK, I see you have already answered your own question. So I'll just add some additional information.

Other possible homes for the icon file can be seen by looking at the /root/.jwmrc file. For instance, in the .jwmrc file for Precise 5.7.1, these directories are listed:
Code:
<IconPath>/usr/local/lib/X11/mini-icons</IconPath>
<IconPath>/usr/local/lib/X11/pixmaps</IconPath>
<IconPath>/usr/share/pixmaps</IconPath>
<IconPath>/usr/local/share/pixmaps</IconPath>



goingnuts wrote:
It seems to do nothing. I was hoping to have a window icon - but the "X-window-icon" sticks.

Rather than have a tasklist in the tray, some older window managers simply placed an icon on the desktop for minimized application windows. That is what the /usr/include/X11/bitmaps/calculator bitmap file is used for.


The /usr/include/X11/bitmaps/gray3 file is another bitmap file that is sometimes used by xcalc. If this file is needed but missing, xcalc will give a warning similar to the warning for the "calculator" bitmap file. I've attached a copy of this file. Download it to /usr/include/X11/bitmaps/ then gunzip it. Some Puppy users will probably never see a warning if this file is missing because some Puppies don't include the resource file that adds color to the xcalc window.

Since Puppy is puppy-sized, one of the resource files for xcalc is omitted from some (perhaps all) Puppies. If one adds the file /etc/X11/app-defaults/XCalc-color, and configures X to support it, the calculator will appear in color. (See attached screenshot). I've attached a copy of that file as well. Download it to /etc/X11/app-defaults/ then gunzip it.

To configure X so that that resource file will be read, one needs to add the following three lines to the end of the /root/.Xresources file and restart the X server:
Code:
#ifdef COLOR
*customization: -color
#endif


Also, you may notice that when you use the Reverse Polish Notation mode of xcalc (by using the -rpn option), the label on the Enter button doesn't fit. (See attached screenshot). This is also related to Puppy being puppy-sized. The font intended to be used is not included in some (perhaps all) Puppies. Puppy tries to emulate it with one of its few included fonts, but it isn't perfect.

I've also attached a copy of that font for anyone that wants to correct the appearance of that button. Download it to your miscellaneous fonts directory (on Precise 5.7.1 it is /usr/share/X11/fonts/misc/). You may gunzip it to be consistent with the other files in that directory, but it should work even if you leave it as a .gz file. (Note that the attached file is for the ISO8859-1 character set. This may not work if your language requires another character set.)

You will then need to edit /usr/share/X11/fonts/misc/fonts.alias to modify the line that begins with "6x12" so that it looks like this line:
Code:
6x12       -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1

Lastly you will need to run these two commands:
Code:
mkfontdir /usr/share/X11/fonts/misc/
xset fp rehash



Note that the attached screenshot was made before adding the gray3 pixmap file and the 6x12-ISO8859-1.pcf.gz font file.
xcalc_guises.png
 Description   The various guises of xcalc
 Filesize   184.17 KB
 Viewed   294 Time(s)

xcalc_guises.png

gray3.gz
Description  Bitmap pattern for color xcalc
(/usr/include/X11/bitmaps/gray3)
gz

 Download 
Filename  gray3.gz 
Filesize  100 Bytes 
Downloaded  54 Time(s) 
XCalc-color.gz
Description  Resouce file for color xcalc
(/etc/X11/app-defaults/XCalc-color)
gz

 Download 
Filename  XCalc-color.gz 
Filesize  1.17 KB 
Downloaded  55 Time(s) 
6x12-ISO8859-1.pcf.gz
Description  Font for xcalc -rpn
(/usr/share/X11/fonts/misc/6x12-ISO8859-1.pcf.gz)
gz

 Download 
Filename  6x12-ISO8859-1.pcf.gz 
Filesize  4.45 KB 
Downloaded  58 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0959s ][ Queries: 13 (0.0131s) ][ GZIP on ]