While we are on the subject of Text widgets...

While we are on the subject of Text widgets...

Post by Keog » Sat, 08 Nov 2003 09:35:39


Finally got Tk working (nobody told me to read the instructions first:)
and have been whanging away at learning it for a week or so. Actually I
am trying to find a replacement for the apparently abandoned Kylix.

Anyway, I was learning by porting over one of my most used projects, one
that has a large text(box) widget as the main component and everything was
going great - in fact, it is still going great except that I suddenly
noticed that the vertical scrollbar for the text box is on the WRONG side
- left instead of right.

No problem, I just whipped out my new copy of Mastering Perl/TK (If you
are also a newbie, you have to get this book - it is really good) and went
to the very large chapter on text widgets and looked for the
move-the-scrollbar-position-parameter...

Nothing. Then I looked in the scroll widget stuff. Still nothing.

Either the info is not there or I can't recognise the form that it is in.
Plus, all the pictures of text and other text holding widgets in the book
show the vertical scrollbar to be on the right side. And the few examples
that I can find on the web also have it in the usual place.

This is obviously something so simple that the authors don't think it even
needs to be discussed. Can anyone clue me in?

Thanks
Keogh
 
 
 

While we are on the subject of Text widgets...

Post by Darek Adam » Sat, 08 Nov 2003 10:03:10


Hi

$t->Scrolled('Text',-scrollbars=><side>);
where <side> must be one of the following 'e','w','s','n' - they
stand for east/left, west/right, south/bottom, and north/top respectively
- is that what you need?

Ragards
Darek

 
 
 

While we are on the subject of Text widgets...

Post by Darek Adam » Sat, 08 Nov 2003 10:05:42


Hi

$t->Scrolled('Text',-scrollbars=><side>);
where <side> must be one of the following 'e','w','s','n' - they
stand for east/right, west/left, south/bottom, and north/top respectively
- is that what you need?

Ragards
Darek
 
 
 

While we are on the subject of Text widgets...

Post by robertmein » Sat, 08 Nov 2003 12:47:56

> Anyway, I was learning by porting over one of my most used projects, one

MPTk, page 135 ... The Scrolled Method:

$t = $mw->Scrolled(
"Text",
-scrollbars => 'e',
)->pack(
-fill => 'both',
-expand => 1
);

Regards,
Robert
 
 
 

While we are on the subject of Text widgets...

Post by Keog » Sat, 08 Nov 2003 14:14:17


Thanks Guys. That did it.

Keogh
 
 
 

While we are on the subject of Text widgets...

Post by Slaven Rez » Tue, 11 Nov 2003 00:00:42

"Keogh" < XXXX@XXXXX.COM > writes:


Why do you think it's the wrong side --- this is old X11 app behavior
(see xterm for an example).

Regards,
Slaven

--
Slaven Rezic - XXXX@XXXXX.COM

Dump a Tk canvas as an xfig file:
http://www.yqcomputer.com/ ::CanvasFig
 
 
 

While we are on the subject of Text widgets...

Post by Keog » Tue, 11 Nov 2003 03:55:53


Well, for one thing, Bill Gates says that it is on the wrong side:)

For another, giving it to my users would be like selling a car in the US
with the steering wheel on the right side, rather than the left. The car
may be perfectly fine, nothing is illegal about the placement of the
controls, but you would probably have trouble giving the car away, let
alone selling it.

Keogh