LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-01-2004, 08:14 PM   #1
black
Member
 
Registered: Jul 2002
Location: nowhere
Distribution: GNU
Posts: 118

Rep: Reputation: 15
python GUI problem~


Hi all~

I'm coding with Python GUI(ie Tkinter concisely) and i wonder whether we could get current OS' clipboard available, and event more, anyone can inspires me how we can achieve undo and redo function ?

many many thanx~
 
Old 01-02-2004, 02:10 AM   #2
SolarBear
Member
 
Registered: Oct 2003
Location: Québec, Canada
Distribution: Gentoo 2005.0(desktop), Debian 3.0 r2 (server)
Posts: 105

Rep: Reputation: 15
You could try this partial code (haven't tried it, not on my own box right now).

Code:
from Tkinter import *
root=Tk()
text=Text(root)
text.pack()
root.clipboard_clear()
root.clipboard_append('some string')
def paste(event):
    text.event_generate('<someevent>')
text.bind('<FocusIn>',paste)
root.mainloop()
http://www.faqts.com/knowledge_base/...d/4668/fid/264

Of course, note that the behaviour of the clipboard will most probably differ from one OS to the other.
 
Old 01-02-2004, 06:31 PM   #3
sonar0m
LQ Newbie
 
Registered: Dec 2003
Location: Austin, TX
Posts: 5

Rep: Reputation: 0
hehe well i have a idea for a undo function.
-you would need a log file. ((undo and redo info))
-something to watch for the commands(IE. when you move something you would get the original directory and the new)
-a directory ((probably a file)) of commands and there assorted counter parts **i would use a dictionary ((dam sp))** load them up from the file in a particular format like move: <A> move <B> || <B> move <A>
this is needed in-case some one makes a new command or we for got something.


things i see that we could cover with the undo and re do command:
ovcorse move back, restore from trash can, delete a newly created file

the problem comes with the commands in the terminal you would need to look up and log before ... but that would be a bit tricky

?? what do you thing?

-Marcus

((self trained python coder but i don't know nothing about GUI where might ya learn?))

if you would like more info about this just say the word.
 
Old 01-04-2004, 08:35 AM   #4
black
Member
 
Registered: Jul 2002
Location: nowhere
Distribution: GNU
Posts: 118

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by SolarBear
You could try this partial code (haven't tried it, not on my own box right now).

Code:
from Tkinter import *
root=Tk()
text=Text(root)
text.pack()
root.clipboard_clear()
root.clipboard_append('some string')
def paste(event):
    text.event_generate('<someevent>')
text.bind('<FocusIn>',paste)
root.mainloop()
http://www.faqts.com/knowledge_base/...d/4668/fid/264

Of course, note that the behaviour of the clipboard will most probably differ from one OS to the other.
thanx i'll try that out. it is very strange that no comments on those 3 methods on Tkinter's online book
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Terminal Gui Kedelfor Programming 2 10-24-2005 03:50 PM
recommended GUI toolkit for use with python servnov Programming 4 01-02-2005 06:13 PM
what do I need for GUI design with python? servnov Programming 3 10-19-2004 08:23 PM
suggestions regarding python and gui packages h/w Programming 7 04-13-2004 08:47 AM
python GUI editor/complier? 286 Programming 5 02-03-2004 08:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration