Re: [Tkinter-discuss] No module named tkMessageBox in python3.2??

2011-08-21 Thread Firat Ozgul
In my previous message I said: "Also this module is **not** available in tkinter". It should be: "Also this "module is **now** available in tkinter". 2011/8/22 守株待兔 <1248283...@qq.com>: > python3.2 > Python 3.2 (r32:88445, Mar 25 2011, 19:28:28) > [GCC 4.5.2] on linux2 > Type "help", "copyright",

Re: [Tkinter-discuss] No module named tkMessageBox in python3.2??

2011-08-21 Thread Firat Ozgul
tkMessageBox has been renamed to messagebox in Python 3.x. Also this module is not available in tkinter. Therefore: [code] >>> from tkinter import messagebox >>> messagebox.showwarning("hello", "world") [/code] 2011/8/22 守株待兔 <1248283...@qq.com>: > python3.2 > Python 3.2 (r32:88445, Mar 25 2011,

Re: [Tkinter-discuss] lambada difficult to understand

2011-08-21 Thread Firat Ozgul
With lambda your codes will look like this: [code] from Tkinter import * fields = 'Name', 'Job', 'Pay' def fetch(entries): for entry in entries: print 'Input => "%s"' % entry.get() # get text def makeform(root, fields): entries = [] for field in fields: row = Frame(r

Re: [Tkinter-discuss] 回复: 回复: bind between event and callback

2011-08-17 Thread Firat Ozgul
I think there is no difference. Both positions seem reasonable to me. So you can insert the set_focus line at whichever position you wish. 2011/8/17 守株待兔 <1248283...@qq.com>: > code1 > from Tkinter import * > root = Tk() > def callback(event): >print "i am here" > > frame = Frame(root, width=1

Re: [Tkinter-discuss] bind between event and callback

2011-08-16 Thread Firat Ozgul
The reason why you get no response is the lack of focus when you first create the frame. Therefore you should set the focus on frame manually, like this: [code] from Tkinter import * root = Tk() def callback(event): print "i am here" frame = Frame(root, width=100, height=100) frame.bind("", ca

[Tkinter-discuss] as close windows by separate modules

2010-12-17 Thread Firat Ozgul
Check the following out. code.py from tkinter import messagebox from tkinter import * from tkinter import ttk class Option: def quit(master): if messagebox.askyesno(message='Close window'): master.quit() main.py --- from tkinter import * from tkin

Re: [Tkinter-discuss] Control position of Tkinter common dialogs?

2010-10-26 Thread Firat Ozgul
Hello, I do not know whether there is an easier way to accomplish what you want, but maybe you can create a new toplevel window in the middle of the screen, then make it invisible and position the dialog windows relative to this new toplevel... Like this: http://paste-it.net/public/q2a5594/ I kno

Re: [Tkinter-discuss] Can't do proper event binding in a for loop

2010-10-19 Thread Firat Ozgul
Hello, for loop doesn't work, because in a for loop all events will be bound all at once, and you will only see the effect of the last binding. You need something that binds events one by one. If I were you, I would use the next() method of Python iterators: http://paste-it.net/public/pe0b871/

Re: [Tkinter-discuss] Tkinter doesnt respond until after wait command

2010-10-09 Thread Firat Ozgul
Hello, Take a look at this code: http://paste-it.net/public/l0b490d/ 2010/10/9 Wave71 > > I create and object (text) > then I want it to wait for about 3 seconds > then I want it to delete that object > > import time > > text = w.create_text(x,y, text) > time.sleep(3) > w.delete(text) > > > Bu

Re: [Tkinter-discuss] How do I delete the current line in a Text widget

2010-10-02 Thread Firat Ozgul
You can use "current linestart" and "current lineend". For example http://paste-it.net/public/x8d0f7b/ 2010/9/30 Baz79 > > What arguments should delete() take in order to delete the current line? > > Thanks, > > Barry > -- > View this message in context: > http://old.nabble.com/How-do-I-delete-

Re: [Tkinter-discuss] tkinter module

2010-09-23 Thread Firat Ozgul
Hello, Until Python's 3.0 version, the name of the Tkinter module was "Tkinter". Therefore we used to import this module as: >>> import Tkinter Starting from Python 3.0, the name of this module is "tkinter". So you should issue the following command to import the module: >>> import tkinter Nor

Re: [Tkinter-discuss] (no subject)

2010-09-22 Thread Firat Ozgul
Hello, I modified your code to make it work: http://paste-it.net/public/m46ae5d/ Certainly, to be able to re-write the code, I made some assumptions and guesses about your original intentions. Just check the code to see if it is close to what you want. Firat 2010/9/21 Devred, Emmanuel > Hel

Re: [Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

2010-08-24 Thread Firat Ozgul
fonts in my code (under Ubuntu), and they all work. Good Luck! Firat 2010/8/24 Michael Lange > Hello, > > Thus spoketh Firat Ozgul > unto us on Tue, 24 Aug 2010 16:54:30 +0300: > > > Hello, > > > > It looks like that postscript() function cannot render every fo

Re: [Tkinter-discuss] Entry Widget that can't enter into at first.

2010-08-24 Thread Firat Ozgul
:) > > Regards > > Michael > > > 2010/8/24 Cameron Laird > > > > > On Tue, Aug 24, 2010 at 11:57:57AM +0300, Firat Ozgul wrote: > > >. > > >. > > >. > > &g

Re: [Tkinter-discuss] Entry Widget that can't enter into at first.

2010-08-24 Thread Firat Ozgul
I tested the original poster's code on Ubuntu Karmic Koala (GNOME). As soon as the file dialog is closed, the entry widget is ready for typing. So it seems that this problem is specific to Windows OS. 2010/8/24 Cameron Laird > On Tue, Aug 24, 2010 at 03:36:56PM +0300, Firat Ozg

Re: [Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

2010-08-24 Thread Firat Ozgul
onfiguring TrueType fonts: http://www.faqs.org/docs/Linux-mini/TT-Debian.html Firat 2010/8/24 Michael Lange > Hi Firat, > > Thus spoketh Firat Ozgul > unto us on Tue, 24 Aug 2010 12:51:48 +0300: > > > Hello, > > > > I found some useful stuff at: > > h

Re: [Tkinter-discuss] Entry Widget that can't enter into at first.

2010-08-24 Thread Firat Ozgul
I could reproduce the error on a Windows XP machine. I will test it on GNU/Linux (Ubuntu Karmic Koala - GNOME) in the evening. 2010/8/24 Cameron Laird > On Tue, Aug 24, 2010 at 11:57:57AM +0300, Firat Ozgul wr

Re: [Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

2010-08-24 Thread Firat Ozgul
Serif Condensed-Bold-R-Normal--*-120-*" * 2010/8/24 Michael Lange > Thanks Firat for the reply, > > Thus spoketh Firat Ozgul > unto us on Tue, 24 Aug 2010 09:16:41 +0300: > > > Hello, > > > > Unfortunately there are not enough documentation about Python-tk

Re: [Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

2010-08-24 Thread Firat Ozgul
;, "families") [/code] Please try this way, and tell me if it solves the problem. 2010/8/24 Michael Lange > Thanks Firat for the reply, > > Thus spoketh Firat Ozgul > unto us on Tue, 24 Aug 2010 09:16:41 +0300: > > > Hello, > > > > Unfortunately there

Re: [Tkinter-discuss] Entry Widget that can't enter into at first.

2010-08-24 Thread Firat Ozgul
Actually, I can reproduce the error described by the original poster... I am not exactly sure about the true dynamics of the solution, but after_idle() method seems to solve the problem in a way. Perhaps, for one reason or the other, the program cannot return to the main window properly even though

Re: [Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

2010-08-23 Thread Firat Ozgul
In addition to my previous e-mail, I want to add the following link in which there are some explanations and an example code for creating postscript. However the following is only useful if you are into Tcl/Tk: http://flylib.com/books.php?ln=en&n=3&p=480&c=292&p1=1&c1=1&c2=478&view=2 Firat 2010/

Re: [Tkinter-discuss] Canvas.postscript() fails to render some fonts properly

2010-08-23 Thread Firat Ozgul
Hello, Unfortunately there are not enough documentation about Python-tk postscript manipulation. Information is scattered here and there. A sample code could be like this: [0] http://paste-it.net/public/l5a7036/ Some useful discussions on the topic: [0] http://www.velocityreviews.com/forums/t326

Re: [Tkinter-discuss] Multiple windows, accessing variables across them won't work for me (Using Tkinter)

2010-08-22 Thread Firat Ozgul
Hello, In Tkinter, when you want to create a secondary window you do not have to implement a whole new class. What you need to do is just create a new toplevel. Furthermore, never use "globals" within a class. I made some modifications to your code. You can find the modified version of your code

Re: [Tkinter-discuss] update of elements in GUI

2010-08-19 Thread Firat Ozgul
rgs):var.set(var.get()+1)root.after(1000, increment) >> >> >> but1=Button(text="click me", command=increment) >> but1.grid() >> >> but without any success. >> >> cheers! >> >> >> 2010/8/19 Firat Ozgul >> &

Re: [Tkinter-discuss] update of elements in GUI

2010-08-18 Thread Firat Ozgul
[quote]Cameron Laird: "update() is *not* essential: after() provides a non-threading alternative."[/quote] I agree. If you would not like to use update(), you can use after() in your code with pretty much the same functionality: http://paste-it.net/public/e7ce371/ ___

Re: [Tkinter-discuss] update of elements in GUI

2010-08-17 Thread Firat Ozgul
If I am not mistaken you want something like this: 1) http://paste-it.net/public/i2de44d/ (with threads and classes) 2) http://paste-it.net/public/f5e340e/ (without threads and classes) Note that without threads, we need to use the update() method. However, without threads you will experience so

Re: [Tkinter-discuss] Python Tkinter Simple Qn

2010-08-12 Thread Firat Ozgul
My previous code was erroneous. Therefore I edited it. http://paste-it.net/public/u46e119/ 2010/8/12 Chris Chia > Hi i have the following problem with Python Tkinter. > I switch to switch the image background (which i used Tkinter.Label with > image arg to display on the GUI). > > How can I do

Re: [Tkinter-discuss] Python Tkinter Simple Qn

2010-08-11 Thread Firat Ozgul
Hello, I posted the code in here: http://paste-it.net/public/y1ba880/ Firat 2010/8/12 Chris Chia > Hi i have the following problem with Python Tkinter. > I switch to switch the image background (which i used Tkinter.Label with > image arg to display on the GUI). > > How can I do that? the cal