Text with a button inside : TextArea « GUI Tk « Python

Python
1. 2D
2. Application
3. Buildin Function
4. Class
5. Data Structure
6. Data Type
7. Development
8. Dictionary
9. Event
10. Exception
11. File
12. Function
13. GUI Pmw
14. GUI Tk
15. Language Basics
16. List
17. Math
18. Network
19. String
20. System
21. Thread
22. Tuple
23. Utility
24. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Python » GUI Tk » TextAreaScreenshots 
Text with a button inside
Text with a button inside


from Tkinter import *

root = Tk()
root.title('Text')
text = Text(root, height=26, width=50)
scroll = Scrollbar(root, command=text.yview)

text.configure(yscrollcommand=scroll.set)

text.tag_configure('bold_italics', font=('Verdana', 12'bold', 'italic'))

text.tag_configure('big', font=('Verdana', 24'bold'))

text.tag_configure('color', foreground='blue', font=('Tempus Sans ITC', 14))

text.tag_configure('groove', relief=GROOVE, borderwidth=2)

text.tag_bind('bite', '<1>',
              lambda e, t=text: t.insert(END, "I'll bite your legs off!"))

button = Button(text, text='I do live at 46 Horton terrace')
text.window_create(END, window=button)
text.insert(END, 'I dare you to click on this\n', 'bite')
text.pack(side=LEFT)
scroll.pack(side=RIGHT, fill=Y)

root.mainloop()


           
       
Related examples in the same category
1. Simple Text (TextArea): font, color, grooveSimple Text (TextArea): font, color, groove
2. Text with font settingsText with font settings
3. Text component with different font style textText component with different font style text
w__w__w_.ja__v_a_2s__.___c___om | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.