Alan Gauld | 20 Apr 19:30 2014

Is this the right place for Tix questions?

I don't see a separate Tix group so is this a valid place
to ask Tix questions? I've been trying to use some of
the Tix widgets and running into issues, especially
with tix.Grid formatting.

--

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos
GKalman | 15 Mar 02:20 2014
Picon
Picon

Need help using Tkinter Widget lift() and lower() methods with Place geometry Manager

"""
I tried a simple case:
Frame with two Canvas widgets. I drag (i.e. move) Canvas #1. When it
overlaps with Canvas #2 neither the lift() nor the lower() methods work.
Why? 
"""
from Tkinter import *

class myObject():
    #--------------------------------
    def __init__(self,root):
        self.root = root

        #place a Frame on the root:
        self.f = Frame(self.root, bg="yellow", width=600, height=400)
        self.f.pack()

        #place a Canvas on the Frame:
        self.c =Canvas(self.f, bg="cyan",width=100,height=50)
        #NW-vtx of Canvas:
        self.xNW=10
        self.yNW=10
        self.c.place(x=self.xNW,y=self.yNW)

        ##event-generators:
        self.c.bind('<ButtonPress-1>', self.startMoveWindow)
        self.c.bind('<B1-Motion>', self.MoveWindow)

        self.c2=Canvas(self.f,bg="red",width=100,height=100)
        self.c2.place(x=300,y=200)
(Continue reading)

deepak | 12 Mar 18:08 2014
Picon

how to get values form the custom widget module to the parent frame widget in Tkinter?

I am ne to python GUi, I have built a cust frame by inheriting the Frame ,
the code is as follows :

    from Tkinter import *
    from logging import exception
    import tkFileDialog
    import  pickle
    import os.path

    STATION_NAME, TARGET_NAME, HOST_NAME, TARGET_IP, HOST_IP, EXCEL_FILE =
range(6)

    

    class NAddStation(Frame):
        def __init__(self, parent=None):
            Frame.__init__(self, parent)
            self.pack(side=TOP, expand=YES, fill=BOTH)
            self.tempVar = []
            # Label Area
            self.labels = ["Station Name :", "Target Name  :", "Host Name   
:", "Target's IP  :", "Host's IP    :",
                           "Excel File   :"]
            self.REMOVE =1
            self.ADD = 2
            self.UPDATE = 3
            # Entry Area
            self.Entry_Target_Name = None
            self.Entry_Host_Name = None
            self.Entry_Target_IP = None
(Continue reading)

memilanuk | 11 Mar 04:27 2014
Picon

importing tk.W?

So... this is kind of twisting my brain a bit.  Not sure I understand 
how/why this works the way it does.  Some help or explanation would be 
appreciated.

On the one hand, I keep reading about the evils/perils of wildcard 
imports and recommendations for named imports.  On the other hand, it 
seems like nearly every tkinter example in books, guides, tutorials that 
I see uses a wildcard import.

So I was trying to follow along some code examples from a recent book, 
and also trying to use python3 as much as practical.  Given that the 
original book code was python 2.x and I had to change 'Tkinter' to 
'tkinter', I figured why not change to using a named import, i.e.

import tkinter as tk

rather than

from Tkinter import *

Other than having to import a 'tk.' to widget names, I figured I should 
be good to go.  Unfortunately not.  The book had code like this:

from tkinter import *
root = Tk()
Label(root, text="Username").grid(row=0, sticky=W)

While what I was coming up with was more like this:

import tkinter as tk
(Continue reading)

Bob Greschke | 28 Feb 20:09 2014

Re: Tracebacks


On 2014-02-28, at 12:08, Bob Greschke <bob <at> passcal.nmt.edu> wrote:

It doesn't, this would just be more elegant, right?  It just seems funny that the interpreter doesn't help
out this one little bit more.  I'd even say why not just have a Python command that you put in your program (not
on the #! line) that tells the interpreter what to globally do with traceback error messages, especially
since these things can happen and the program just keep on running.  "set stdtraceback to file X".  For a
non-threaded/non-GUI program it might not be that big of a deal -- it hits a bug and stops -- but for a big
Tkinter program you could just keep selecting menus and buttons and never know there was a problem
somewhere.  Yes there is the logging and the traceback modules and all of that, but that's a lot of
duplication of labor.  The interpreter already knows everythin
 g, you just can't tell it what to do with the messages to make it helpful.  It seems like a small oversight to me.

On 2014-02-28, at 09:35, Cam <camfarnell <at> bitflipper.ca> wrote:

> I'm probably not understanding the question. How does what you propose differ from wrapping your whole
application in a try/except so that any uncaught exceptions result in information being written to error.txt?
> 
> Cam
> 
> On 14-02-28 11:33 AM, Bob Greschke wrote:
>> This isn't quite a Tkinter thing, but why can't some clever person (I couldn't do it) make it possible for
you to put something like this
>> 
>> #! /usr/bin/python -t "/home/me/error.txt",stderr
>> 
>> at the beginning of a Python program and have the interpreter direct all of the traceback messages to the
file error.txt, and stderr?  I've got a 43,000 line Tkinter/via X11 program and stupid users that won't
tell me when it crashes -- if they even notice.  Right now we create an xterm on their computer then execute
and ssh to the server where the program resides.  The errors come out in that xterm, but if the users quit they
(Continue reading)

Bob Greschke | 28 Feb 16:33 2014

Tracebacks

This isn't quite a Tkinter thing, but why can't some clever person (I couldn't do it) make it possible for you
to put something like this

#! /usr/bin/python -t "/home/me/error.txt",stderr

at the beginning of a Python program and have the interpreter direct all of the traceback messages to the
file error.txt, and stderr?  I've got a 43,000 line Tkinter/via X11 program and stupid users that won't
tell me when it crashes -- if they even notice.  Right now we create an xterm on their computer then execute
and ssh to the server where the program resides.  The errors come out in that xterm, but if the users quit they
are gone.  It seems like the interpreter would be the smartest place to put something like this since it
controls everything, and so you don't have to try and guess in which section of code you misspelled a
variable name and put it in a try-except.

Isn't this reasonable?  There are all kinds of questions about this problem, but never any really good
solutions.  I like this one. :)  I just wouldn't have any idea how to do it, or if it's even possible.

Bob
tarball69 | 17 Feb 14:29 2014
Picon

tkRAD - XML widget building for Tkinter

Hello there,

Would it be possible for me to aknowledge good people Tkinter has now a
complete *XML widget building* library named *tkRAD*?

Wiki URL: https://github.com/tarball69/tkRAD/wiki

Project GitHub: https://github.com/tarball69/tkRAD

Project downloads: https://github.com/tarball69/tkRAD/releases

I've worked hard for this wiki wiki documentation, so please, read
documentation before asking thousands of questions.

Thanks a lot.

--
View this message in context: http://python.6.x6.nabble.com/tkRAD-XML-widget-building-for-Tkinter-tp5047808.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
Kevin Walzer | 14 Feb 16:39 2014

Re: Differences on Mac and Windows

On 2/14/14, 10:21 AM, Bhaskar Chaudhary wrote:
> Hi Kevin
>
> On Windows it looks like the following attachment.
>
> regards
> Bhaskar

Thank you. As I expected, that is simply the difference in the font 
rendering engines on both platforms. 8 point Times Bold is as unreadable 
on Word on the Mac is it is in Tk.

--Kevin

--

-- 
Kevin Walzer
Code by Kevin/Mobile Code by Kevin
http://www.codebykevin.com
http://www.wtmobilesoftware.com
Bhaskar Chaudhary | 11 Feb 10:19 2014
Picon

Differences on Mac and Windows

Hi

The following piece of code displays correctly on Windows PC but it
displays all messed up in OS X (10.9.1 and others) as shown in
attachment below.

from Tkinter import *
root = Tk()
root.geometry('142x280+150+200')
root.configure(background='#4D4D4D')
mytext = Text(root, background='#101010', foreground="#D6D6D6",
borderwidth=18, relief='sunken',width=16, height=5, font="Times 8
bold" )
mytext.insert(END, "Style is knowing \nwho you are, what \nyou want to
say, \nand not giving a \ndamn.")
mytext.grid(row=0, column=0, columnspan=6, padx=5, pady=5)
root.mainloop()

Any reasons why it shows the way it does on Mac.
Thanks.

Version Info:
Python 2.7.3
>>>> Tkinter.__version__
> '$Revision: 81008 $'
>>>> Tkinter.TclVersion
> 8.5
>>>> Tkinter.TkVersion
> 8.5

(Continue reading)

Vasilis Vlachoudis | 7 Feb 17:46 2014
Picon
Picon

Interrupt a long process

Hi all,

in my canvas sometimes it happens to have a long process to insert lots of items.

This typically takes a lot of time (up to min) so I want to give the possibility to the user
to interrupt this process.
And since I am adding to the Canvas I cannot push it on a thread.

So in the main thread, in the big loop, once I exceed a certain time
I display a button to interrupt the long process and I call the update_idletasks()
periodically. However it is not possible for the user to click on the button.

It seems that the update_idletasks doesn't update the "Button-1" messages
How can I do it?

Thanks in advance
Vasilis
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss
Pierre Dagenais | 4 Feb 22:29 2014
Picon

Re: root


On 14-02-04 04:07 PM, Bryan Oakley wrote:
> You must have a root window. If you do not create one, one will be created
> for you. That's just how tkinter works.
> 
> PEP-20 says "Explicit is better than implicit", so explicitly creating the
> root window is better than letting tkinter implicitly create it for you.
> 
Makes a lot of sense!
Thank you,
> 
> On Tue, Feb 4, 2014 at 2:08 PM, Pierre Dagenais <pierre.dagenais <at> ncf.ca>wrote:
> 
>> This program, example1.py:
>>
>>> from tkinter import *
>>>
>>> root = Tk()
>>> canvas = Canvas()
>>> canvas.pack()
>>>
>>> root.mainloop()
>>
>>
>> and this one, example2.py:
>>
>>> from tkinter import *
>>>
>>> canvas = Canvas()
>>> canvas.pack()
>>>
>>> mainloop()
>>
>> do exactly the same thing, as far as I can tell. Yet, most examples I
>> find on the net use the first form. Why?
>> I must be missing something, but I can't figure what is the utility of
>> root. Can you help?
>>
>> PierreD.
>> _______________________________________________
>> Tkinter-discuss mailing list
>> Tkinter-discuss <at> python.org
>> https://mail.python.org/mailman/listinfo/tkinter-discuss
>>
> 

Gmane