Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple text widgets in one frame 1

Status
Not open for further replies.

WernerWeiland

Programmer
Oct 15, 2002
1
CH
hello everybody,
i have to write a text editor. multiple text widgets must be possible. how can i realize, that the current text widget overlays the other ones. with "raise" and "lower" i then can place the required one in the foreground. how can i tell the packer, to place a new text widget exactly over (cover up) the other text widgets.
can anybody help me ?
thanks werner !!
 
The packer doesn't permit the slaves overlap:

From the manual:
Once a given slave has been packed, the area of its parcel is subtracted from the cavity, leaving a smaller rectangular cavity for the next slave.

You can use 'place' to have the slaves overlapping.

You can also be interested with the Mysund_MDI package:
A Multi Documents Interface, ala Windows.

Good luck

ulis
 
Probably a better approach would be to use pack forget (or grid forget if you're gridding your widgets) to remove the currently displayed text widget from the screen, and then pack (or grid) the new text widget in its place. (If you're using pack, you might need to use the pack -before or pack -after options to get the widget displayed in the correct packing order. Check the pack reference page for more information.)

Actually, once I stop and think about it, it's likely that you've got scrollbars hooked up to your text widgets, and so you're going to have to get the scrollbars working properly with the "swap" as well. So, you could modify your scrollbars to hook them up to the new text widget. But that seems like a bother to me. Instead, I'd have a complete text-widget-and-scrollbar assembly inside of a frame as my "unit" that I'd be swapping in and out.

And overall, this is going to be simpler if you use some existing manager megawidget to handle all of this for you. And almost all Tcl widget extensions seem to provide one, usually called a "Notebook" or "Tabset," and often with handy selection tabs implemented for you as well. You can search the Tcl'ers Wiki ( for examples. Some starting points are: "notebook," "tabnotebook," "incr Widgets," "BWidgets," "BLT," and "Tix," - Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top