#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    6
    Rep Power
    0

    Tkinter help (warning: noobish question)


    ok, i have edited this post now.

    I managed to figure out how to change the fonts and size, and all thats left is to figure out how to cut/copy/paste text and also limit it with selected text and if no text is highlighted then everything in the text box will be effected. By selected/highlighted i mean where you drag your cursor over it and it becomes blue you know.

    Thanks for the help, and it is greatly appreciated. Incase your wondering its for an email program for my dad. If it turns out to be good i may release it as open source publicly. If I can get the help i need from someone i will even give you half credit to the program as well.

    Thanks again.
    Last edited by Nick889; January 10th, 2004 at 11:45 PM.
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Sad to say but there doesn't seem to be that much about Tkinter online, probably better of with a book like "Programming Python"...

    Anyway they best link i've found for TK is on http://www.pythonware.com/library/index.htm

    Mark
    programming language development: www.netytan.com Hula

  4. #3
  5. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Hi Nick,

    The code fragment may help a bit - it copies to the clipboard selected text or if no range selected then all the text. After copying the text the highlighting is removed.

    self.text is a tk multiline ScrolledText box.
    Code:
            if not self.text.tag_ranges(SEL):
                #copy everything
                self.text.tag_add(SEL,'1.0',END)
            text = self.text.get(SEL_FIRST,SEL_LAST)
            self.text.tag_remove(SEL,'1.0',END)
            self.parent.clipboard_clear()
            self.parent.clipboard_append(text)

IMN logo majestic logo threadwatch logo seochat tools logo