f



setting text in label to desired width in terms of number of characters , VNC-Exceed Font problem

Hi all,

I am new to Tcl/Tk.
I got a problem related to setting the width of text in label using
the '-wraplength' option.
I wanted to use "-wraplength" option on the text in the label, setting
it to the specified length. I've gone through the online manuals
avilable and I found out that the length must be specified in the
standard forms of screen distances... but my requirement is that the
label must be 100 characters wide..In standard forms of screen
distances  we generally write as
100c or 100i or 100metc..
 c denoting centimeters, i for inches ,m for millimeters etc..
Is there any option where in which we can wrap the length of the text
after printing a specified number of characters in a label.

I also have another issue.. My application brings up a GUI. Generally
users use VNC or Exceed here. I am reading from a file and getting the
first line displayed on the label on a frame.

I am getting the desired spacing when i am using Exceed but usually
the spacing between the words decreases when i use VNC.
I surfed the net and i found out tat the font path needs to be set..
using 'xset q' option. I made sure tat both the fonts paths in VNC and
Exceed points to 100dpi but still that problem is not rectified.
I think I portrayed the entire problem I faced here... If you require
any further details please mail me
Somebody please help me solving the above issues.

Thanks in advance

Ravikanth


0
rkanth.vvn (26)
2/14/2008 9:30:59 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

3 Replies
10841 Views

Similar Articles

[PageSpeed] 48

On Feb 14, 4:30=A0am, Ravikanth <rkanth....@gmail.com> wrote:

> I surfed the net and i found out tat the font path needs to be set..
> using 'xset q' option.


xset q just "queries" the current settings of the x server. xset fp
(and variations) are used to set the font path.
0
lvirden (1938)
2/14/2008 12:18:00 PM
On Feb 14, 5:18 pm, "Larry W. Virden" <lvir...@gmail.com> wrote:
> On Feb 14, 4:30 am, Ravikanth <rkanth....@gmail.com> wrote:
>
> > I surfed the net and i found out tat the font path needs to be set..
> > using 'xset q' option.
>
> xset q just "queries" the current settings of the x server. xset fp
> (and variations) are used to set the font path.

Thanks Larry for the quick response.

I set the font path of VNC and Exceed using " xset +fp" and made sure
that both the paths are alike
like 100dpi comes before 75dpi etc.. but still i am facing the same
problem as above.
Still i find displays  different. Can you please assist me further in
solving this problem?


0
rkanth.vvn (26)
2/14/2008 2:17:47 PM
On Feb 14, 1:30 am, Ravikanth <rkanth....@gmail.com> wrote:
> Is there any option where in which we can wrap the length of the text
> after printing a specified number of characters in a label.

Here is a code fragment that does what you want.  It is bound to the
Configure event so that the wraplength follows the size when the user
resizes the window.  It is written very specifically (not generically)
but it should give you the idea.  Note that "9" is the width of
borders
and padding, plus 1.

        # for resizes, use the resized-size for wrapping
        set ww [expr { [winfo width $statwin.rs_htitles_l] - 9 }]
        if { $ww < 100 } { # for initialization when there's no width
yet, use the preference value
            set pitch [expr { 0.1*[font measure muMonoFont
{1234567890}] }]
            set ww [expr { int( $::PREF::textWidthMax*$pitch +
0.9 ) }]
        }
        $statwin.rs_htitles_l configure -wraplength $ww


Note that labels do thier wrapping differently than the text widget,
which
is a real annoyance to me!

Donald Arseneau                        asnd@triumf.ca
0
asnd (4601)
2/16/2008 12:12:59 AM
Reply:

Similar Artilces:

How to set width of text input to physical text width
I have a grid. When the focus is put on a cell an input is created with the value being the cell's text. I would like to size the input to the physical width of the text. Ideas? John function editCell (cell) { if (document.getElementById) { cell.normalize(); var input = document.createElement('INPUT'); input.setAttribute('value', cell.firstChild.nodeValue); input.setAttribute('size', cell.firstChild.nodeValue.length); //RATHER THAN SET THE SIZE, I WOULD PREFER TO SET STYLE WIDTH input.onblur = function (evt) { setCell(this.parentNode,t...

Chinese character sets, was Re: Problem with Latin-1 character set in French
>Already done. >See CP 252: >ftp://medical.nema.org/medical/dicom/final/cp252_ft.pdf >You now have UTF-8 (which can be used for any country) >and GB18030 for where it is required or for Chinese glyphs not >representable in Unicode. >I have some test images using these (and other) character >sets on my web site at: >http://www.dclunie.com/images/charset/ >I regularly use these and other character sets with Java and >it works very well. See for example the viewer for the NEMA >MR Multiframe project which handles all internationalized >character sets in DICOM images: >ftp://medical.nema.org/medical/dicom/MRMultiframe/ >The underlying Java DICOM toolkit documentation and >source for this will be available shortly. >david Hi, is MRMultiframe open source? pingyingtu wrote: > Hi, is MRMultiframe open source? Yes. The display and validation code is in the pixelmed toolkit and the images are on the NEMA web site. David ...

font problem in 'set label'
Hi, I got ugly display of the text given by 'set label' in postscript terminal. For other text given by 'set xlabel', 'set title', etc., they all looks good on screen. I think the difference is that 'set label' use 'type 3' fonts, however, other commands use 'type 1' fonts. When printing out, they all looks good. Is there any way I can force 'set label' to use 'type 1' fonts? Thanks. steve <zj.hu@sohu.com> wrote: > I got ugly display of the text given by 'set label' in postscript > terminal. For other text given by 'set xlabel', 'set title', etc., > they all looks good on screen. I think the difference is that 'set > label' use 'type 3' fonts, however, other commands use 'type 1' fonts. That would only happen if *you* asked for a font that happens to be a type-3 one, in your 'set label' commands. The internal handling of these commands doesn't induce any such difference. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain. ...

Re: Maximum width of a text file in terms of characters
depends on several things. 1. what do you mean, 2. where - on which OS First 2.: (I assume you mean files on DASD = direct access devices = harddisks for example) On OS with blockwise organized file-structure there is a limit for the LRECL. I think it is around 32000 (not exactly, but a power of 2). There is a RECFM=U (undefined) also, which simulates a kind of endless stream-file, but storing that on a harddisk forces the access routines to split it in blocks anyway. 1.: if you really mean "file" without any relation to SAS, there is no limit for a record. All files are logical st...

Re: Maximum width of a text file in terms of characters #2
According to SAS help ( http://support.sas.com/onlinedoc/913/getDoc/en/hostwin.hlp/chifoptfmain.htm) the maximum LRECL is 1 megabyte (1,048,576 ) The file can be larger than that of course, but it must be split into lines less than or equal to 1,048,576 bytes (characters, in a non-DBCS system) long. -Joe On Fri, Feb 6, 2009 at 8:47 AM, Lou <lpogoda@hotmail.com> wrote: > "chumba" <vikas.dharamsattu@gmail.com> wrote in message > news:e49e32eb-3d2e-4812-8d99-fcdfb7b8e411@w1g2000prk.googlegroups.com... > > > > Hi, > > > > I was wondering if an...

problem with importing text with number and text
i am trying to import a csv file (~49000 rows x 52 cols) with numbers text and characters in it and not getting through. xlsread works fine with all my data except the first column of data which is a time stamp. it converts the time stamps into a constant value through the entire column. To add to the problem, when opened as a text file, every row of the file starts with a comma. I got very close with textscan/textread with all the data coming in but all the rows are transposed into one column one above the other ( imagine 49000 rows 52 cells long transposed one above the other in one column c...

Re: Maximum width of a text file in terms of characters #3
How long is a piece of string? The maximum record length in a file, if that's what you're asking, is implementation dependent. What operating system are you running on? Regards, Jim Lane -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of chumba Sent: 2009, February, 06 5:58 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Maximum width of a text file in terms of characters Hi, I was wondering if anyone knew how many characters are there in a sindle line of a text file? Any light will be most appreciated. Thanks __________________________________...

Setting the column width size to 'n' number of characters
Hi, I am trying to set the size of a table column. But it takes the column size in pixel. But my requirement is to set it to display some n number of characters. Any way of doing it? Thanks in advance, Nivedita nivedita.jadhav@gmail.com wrote: > Hi, > I am trying to set the size of a table column. But it takes the column > size in pixel. But my requirement is to set it to display some n > number of characters. Any way of doing it? > In most fonts, including the default font used by JTable, characters don't have a fixed width. In that case there is no way of doing it. ...

Fonts, font drivers, character sets and Unicode
This is a followup to a question I posted last year. I'm designing some outline fonts (see http://www.cs-club.org/~alex/creative/fonts/index.html for one of them) but I can't persuade OS/2 to recognize its supported character sets properly. The font is created using FontLab TypeTool, which claims to encode all its generated fonts using Unicode. It can export to either Type 1 or TrueType format; I'm mostly using TrueType. In the font header, I set the 'supported codepages' bits to all the character sets I have implemented; at present, I have: 1252, 1251, 12...

Labeling Font Problems
I am trying to label a map using ArcView 3.2. The font is a special one for the Dene language in the NWT of Canada. When I go to choose the font, it appears in the font menu, but once it is chosen, the screen kinda blinks a few times but the font does not show up. What can I be doing wrong???? Thanks all. ...

problem with character set
Hallo, I'm using Knoppix (a distribution on CD based on Debian). The acute character ` (hex. code: b4) is not printed correctly. The shell prints a '?' instead and emacs another, very strange looking character. It is not the keyboard setup (the problem occurs for existing files as well and I checked the keyboard setup with xev). /etc/sysconfig/i18n contains the line (among others) charset = "iso8859-15" I'm not sure, whether this might be the wrong one. I read that iso8859-1 is for western europe and iso8859-2 for middle europe (I'm living in Germany). ...

character set problem
I'm having trouble editing a particular file. It happens to be a printcap file. There is a point in the file, starting just after line 640, where terminal mode emacs displays all subsequent characters as question marks. In X, I see boxes. There are various non-ascii characters at this point in the file. If I open and save the file without doing anything, the file size changes. I don't understand this. My understanding is that emacs will display non-ascii characters as octal escape sequences, which the manual confirms: http://www.sunsite.ualberta.ca/Documentation/Gnu/emacs-18.59/html_node/emacs_10.html I'm obviously clueless. What's happening here? -- Ron Peterson -o) 87 Taylor Street /\\ Granby, MA 01033 _\_v https://www.yellowbank.com/ ---- In article <slrnbqjkb1.vrl.ron.news@homegate.yellowbank.com>, Ron Peterson wrote: > I'm having trouble editing a particular file. It happens to be a > printcap file. There is a point in the file, starting just after line > 640, where terminal mode emacs displays all subsequent characters as > question marks. In X, I see boxes. > > There are various non-ascii characters at this point in the file. > > If I open and save the file without doing anything, the file size > changes. > > I don't understand this. My understanding is that emacs will display > non-ascii characters as octal escape sequences, which the m...

get width of variable-width font text in pixels for treeview column resize
I have a treeview object with a column that could have a lot of text in it.= I'd like to resize the column to be as big as the largest item. With a hor= izontal scrollbar, the user could then see all of the text. However, I can'= t figure out how to get the width of the text that was added to the item. S= o I can set the size to be some wild guess based on the number of character= s, but my font is variable-width, so this is likely to be very wrong. To help explain my dilemma, here's an example. The following script creates= a treeview widget and a horizontal scrollbar. It then populates the treevi= ew with increasingly long strings. At startup, the strings end at the end o= f the window, and there is no way to scroll. The user could manually resize= the column beyond the window width, and then the scrollbar is enabled. But= I'd like this resize to happen automatically, and to the exact width desir= ed. grid [ttk::treeview .l -xscrollcommand ".s set" -height 5] -column 0 -row 0= -sticky nwes grid [ttk::scrollbar .s -command ".l xview" -orient horizontal] -column 0 -= row 1 -sticky we grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1 for {set i 0} {$i<5} {incr i} { set x [string repeat "xxxxxxxxx" $i] set id [.l insert {} end -id $i -text "Line $i of 5: $x"] # here I'd like to resize the column if necessary! but to what width? } Am I missing an easy way to get the width of text ...

What text property setting controls the "look" of the text in label attached to disabled textbox?
You know how the text in the attached label sort of 'greys out' when you click something that sets MyTextbox.Enabled = False? I would like to make a label's text look like that? How do I do it? It look sort-a-like sunken text or shadowed - I don't know what. "MLH" <CRCI@NorthState.net> schreef in bericht = news:sfvab15dith42ec99ur6aeoa6qbgsclse4@4ax.com... > You know how the text in the attached label > sort of 'greys out' when you click something > that sets MyTextbox.Enabled =3D False? >=20 > I would like to make a label's text lo...

character-set setting
All - What's the proper setting that I need to have for the character-set option? I currently use ISO-8859-1 and only use English, not specia characters, etc. but it's annoying because I get messages in UTF-8 and I get that notice at the top of each email. I know I can enable quell-charset-warning, but I was wondering if I should change the value of character-set to something else. Thank you for your help. DJ *** DJ-usenet (edon.johnson@cashette.comet) wrote in comp.mail.pine on May...: :) What's the proper setting that I need to have for the character-set :) option? There ...

Problem setting font family
I have an application which needs to set the font of a label to be the same as "TkDefaultFont" - The familiy will be the same, but possibly one or more of the other attributes changed. On XP (where the family is: "Tahoma") this works fine, but on Solaris (where the family is: "sans-serif") I get an... expected integer but got "sans-serif" ....error. Here is an example:- label .mylabel -text "A test label" pack .mylabel ..mylabel configure -font {-family sans-serif -size 12 -weight bold - slant roman -underline 0 -overstrike 0} I am using: Tcl/Tk 8.5.7 Can anybody help? Many Thanks, =Adrian= Adrian Davis <adrian@satisoft.com> writes: >.mylabel configure -font {-family sans-serif -size 12 -weight bold - >slant roman -underline 0 -overstrike 0} Check the manual for the font command which lists the acceptable forms for font descriptions. You want either: .mylabel configure -font {sans-serif 12 bold} or font create MyFont -family sans-serif -size 12 ... .mylabel configure -font MyFont -- Pat Thoyts http://www.patthoyts.tk/ To reply, rot13 the return address or read the X-Address header. PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD > Check the manual for the font command which lists the acceptable forms > for font descriptions. > You want either: > =A0.mylabel configure -font {sans-serif 12 bold} > or > =A0font create MyFont -family san...

character set problem #2
Hello, I'me not able to solve a character set problem. I have two linux PC: PC1 is OpenSuSE 10.2 and PC2 is OpenSuSE 11.3. Database is on PC2. Table has TABLE_COLLATION='latin1_swedish_ci'. I must insert and select characters like "�", it has "E0" code on: http://www.collation-charts.org/mysql60/mysql604.latin1_swedish_ci.html I use command line mysql or connect from php, results are the same. Select from PC1: it works on rows inserted by PC1, it has bad characters on rows inserted by PC2. Select from PC2: it does not work (all rows have bad characte...

PDF font/character problem
I am sure there is an established solution for such problems, but I am having trouble with a pdf file where the text appears correctly on screen but does not print correctly. The "Print as Image" workaround is not an option due to the circumstances of the project. I believe this is an issue regarding the font embedding because when I attempt to convert the PDF to EPS or PS in Adobe Acrobat 7.0 Pro, the files turn out with jumbled text like the printouts do. I was wondering if anyone can recommend a solution. I was thinking that if there was a way to vectorize the PDF file, so that ...

vertical text in label problems
Hi, I have a question about vertical text property for labels. I have set several labels to show vertical text on one of my forms. I had no problems with them on my desktop computer. Now I installed the same application on my laptop and the text disappeared. The only way I found in order to reveal them was to change the Font to "Aharoni". I do not want to use Aharoni. Other computers may not have it installed, and it doesn't look as nice as Tahoma. I am using on both computers Win XP and Office 03, with Hebrew installed. I am not using Hebrew for the above issue at all. Thanks...

setting text, change the font
Hello, Suppose I have a table like this : <table width = "580"> <tr align = "right" width = 760> <td id = "current_page_inner"> <font size="4" color="lightgreen" face="arial"><b><i> abc </i></b> </font> </td> </tr> </table> .... if I do in code : current_page_inner.children(0).innerText = "bcd" the text is changed to the new text, and the font doesn't change, but the font is not italic and not bold as the original. Why ? Thanks :) "Mr. x" <a@b.com> writes: > Suppose I have a table like this : > > <table width = "580"> > <tr align = "right" width = 760> > <td id = "current_page_inner"> > <font size="4" color="lightgreen" face="arial"><b><i> > abc > </i></b> I recommend against using the font, b and i tags. Use CSS to get the same effect, that is what it was invented for. > </font> > </td> > </tr> > </table> > ... > if I do in code : > current_page_inner.children(0).innerText = "bcd" Amazing, out of the three parts of the expression on the left of the equal sign, all are IE-specific and won't work in Mozilla. It is bad style to refer to an element by using its name as a global variable (bad style, and not likely to wor...

Problems with setting the text in a JLabel
Hey all, I have a gui that is set up using a GridBagLayout. The content pane has nine panels and a JLabel added to it. Each of the nine panels has one JList, two JButtons, and a JLabel, set up in border layout. Here's the problem. Everything works fine until I change the text of the label. Once I do that, the whole display becomes corrupted. The JButtons and JLabels disappear, and the JLists empty. The whole display collapses to a much smaller size in the center of the display. In other forums, I have received advice about making sure that the changing of the text is not in ...

Text file with numbers and text, want to just read numbers
I have a series of text files I want to read. The files begin with header information. The number of rows of header information changes, there is no commenting symbol such as %%, and the header information sometimes has numbers such as a date or a time. I want to read in the number and only the numbers. This is an example of a file: (Again, the header info changes, different # of lines, different text) Vector Signal [Measurement4]: 09/27/2006, 09:05:24 Units: EU Time Real 0 0.053732 9.6e-005 0.11968 0.000192 0.085483 0.000288 ...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

JFreeChart : problem with width of labels
(sorry for my english) Hi I have an horizontal Bar Chart, with labels at the left of each bar. But the space allocated with these labels is too short, and labels are written in several lines. How can I control space allocated with such labels? Thanks Grand Paradis wrote: > (sorry for my english) > Hi > I have an horizontal Bar Chart, with labels at the left of each bar. > But the space allocated with these labels is too short, and labels are > written in several lines. How can I control space allocated with such > labels? > > Thanks Hello, There's a forum on th...

Web resources about - setting text in label to desired width in terms of number of characters , VNC-Exceed Font problem - comp.lang.tcl

List of Killzone characters - Wikipedia, the free encyclopedia
Cpl. Dante Garza is a loyal, optimistic and likable character- an effective team player. A close companion of Sev, the pair have served together ...

Google trials optical character recognition for Now on Tap
Google appears to still be tinkering with the ins and outs of its Google Now on Tap feature. A number of users have begun noting that the software ...

‘Better Call Saul’ may soon feature familiar characters from ‘Breaking Bad’
Positioned as a prequel to Breaking Bad , a show with one of the more fervent fan bases you'll ever encounter, the debut of Better Call Saul ...

'Ghostbusters' director reveals Leslie Jones' controversial character was originally written for Melissa ...
Director Paul Feig has directed Melissa McCarthy in three films, including her breakout role in “Bridesmaids,” so it shouldn’t come as a shock ...

Leslie Jones defends her ‘streetwise’ Ghostbuster character after criticism
I think some people were always going to be butthurt about the all-female Ghostbusters movie . There were lots of men on Twitter complaining ...

Trump’s Greatness — Is It Worth Losing The Good Character Of The American People?
If this be the fruit of Demagogue Donald’s promise of greatness, what greatness will come of the triumph of his self-idolizing ambition?

'Game Of Thrones' Season 6 Spoilers: Will Ian McShane's Character Die In His Debut Episode?
Ian McShane addressed his recent remarks about his role on "Game of Thrones" that sent fans into a hysteria about spoilers.

Killer Instinct character leaks hint at General RAAM and Mira
By way of a Season 3 leak for Killer Instinct , two new characters may have just been revealed. The first is Mira, who is said to be the sister ...

EXCLUSIVE: 'Divergent Series: Allegiant' Cast Dishes on the Film's 'Bad Ass' Female Characters
During an exclusive roundtable discussion with ET, the ladies of The Divergent Series: Allegiant explored the strong but 'messy' characters they ...

Will 'The Walking Dead' Actually Sacrifice The Characters The Comics Demand?
If you couldn’t tell from the Walking Dead premiere weeks ago, in which we saw an enemy group nuked with a rocket launcher, a family slaughtered ...

Resources last updated: 3/13/2016 1:14:45 PM