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
11147 Views

Similar Articles

[PageSpeed] 12

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: