From abraham_h101 at yahoo.ca Sun Aug 5 04:43:26 2007 From: abraham_h101 at yahoo.ca (hani abraham) Date: Sat, 4 Aug 2007 19:43:26 -0700 (PDT) Subject: [Tkinter-discuss] Tix hlist-clearing selection Message-ID: <17275.61771.qm@web51911.mail.re2.yahoo.com> Hi, I'm new to python and i'm using Tix Tree widget in my application. I'm trying to clear the tree selection but no luck so far. I tried selection_clear and anchor_clear but these aren't working. Can someone help? Thanks, Hani Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070804/069b5dfc/attachment.html From brotchie at gmail.com Sun Aug 5 06:50:55 2007 From: brotchie at gmail.com (James Brotchie) Date: Sun, 5 Aug 2007 14:50:55 +1000 Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection In-Reply-To: <8e766a670708042149od8f95f0g148423995e6a98fa@mail.gmail.com> References: <17275.61771.qm@web51911.mail.re2.yahoo.com> <8e766a670708042149od8f95f0g148423995e6a98fa@mail.gmail.com> Message-ID: <8e766a670708042150l422b2f71i312d9a73ea58ac0e@mail.gmail.com> Hey Hani, Are you sure you are calling the selection_clear method of the hlist child widget and not the parent tree? eg. tree = Tix.Tree(root) tree.hlist.selection_clear() If you look in Tix.py you can see that Tree is a compound widget containing two scrollbars and a hlist. class Tree(TixWidget): def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixTree', ['options'], cnf, kw) self.subwidget_list ['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') Thus to clear the hlist selection you must address the child hlist directly and not its parent Tree widget. Cheers, James On 8/5/07, hani abraham wrote: > Hi, > > I'm new to python and i'm using Tix Tree widget in my application. I'm > trying to clear the tree selection but no luck so far. I tried > selection_clear and anchor_clear but these aren't working. Can someone help? > > > > Thanks, > Hani > > ------------------------------ > Ask a question on any topic and get answers from real people. *Go to > Yahoo! Answers.* > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070805/3311f2c5/attachment.html From abraham_h101 at yahoo.ca Sun Aug 5 07:56:18 2007 From: abraham_h101 at yahoo.ca (hani abraham) Date: Sat, 4 Aug 2007 22:56:18 -0700 (PDT) Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection Message-ID: <778266.83339.qm@web51901.mail.re2.yahoo.com> Yes, i used the hlist component of the tree but nothing happens. The thing is I can clear the selection if I use selection_set then selection_clear but i can't clear the selection when it's highlight with a mouse. Thanks, Hani ----- Original Message ---- From: James Brotchie To: Tkinter-discuss at python.org Sent: Sunday, August 5, 2007 12:50:55 AM Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection Hey Hani, Are you sure you are calling the selection_clear method of the hlist child widget and not the parent tree? eg. tree = Tix.Tree(root) tree.hlist.selection_clear () If you look in Tix.py you can see that Tree is a compound widget containing two scrollbars and a hlist. class Tree(TixWidget): def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixTree', ['options'], cnf, kw) self.subwidget_list ['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') Thus to clear the hlist selection you must address the child hlist directly and not its parent Tree widget. Cheers, James On 8/5/07, hani abraham wrote: Hi, I'm new to python and i'm using Tix Tree widget in my application. I'm trying to clear the tree selection but no luck so far. I tried selection_clear and anchor_clear but these aren't working. Can someone help? Thanks, Hani Ask a question on any topic and get answers from real people. Go to Yahoo! Answers. _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070804/7363dfb7/attachment.htm From brotchie at gmail.com Sun Aug 5 13:16:41 2007 From: brotchie at gmail.com (James Brotchie) Date: Sun, 5 Aug 2007 21:16:41 +1000 Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection In-Reply-To: <778266.83339.qm@web51901.mail.re2.yahoo.com> References: <778266.83339.qm@web51901.mail.re2.yahoo.com> Message-ID: <8e766a670708050416j4a6f457exdff2ee76542b32dd@mail.gmail.com> Does this script function as expected on your installation? You should be able to select multiple items in the tree and then clear the selection with the button. Works for me on both winxp and ubuntu with 2.6trunk, 2.5maint and 2.4maintcompiled against tcl8.4.12, tix-8.4.0, tk8.4.12. Which version of python and what tcl/tk/tix libraries are you using? cat hlisttest.py from Tix import * def clearSelection(hlist): hlist.selection_clear() tk = Tk() # create and configure tree tree = Tree(tk) tree.hlist['selectmode'] = EXTENDED tree.hlist['wideselection'] = TRUE tree.hlist['background'] = 'white' # add a couple of tree nodes tree.hlist.add("test1", text="Hello world") for i in range(5): tree.hlist.add_child("test1", text="item%d" % i) # add button for selection clear Button(tk, text="Clear Selection", command=lambda:clearSelection(tree.hlist )).pack() # pack tree tree.pack(expand=TRUE, fill=BOTH) tk.mainloop() On 8/5/07, hani abraham wrote: > > Yes, i used the hlist component of the tree but nothing happens. The thing > is I can clear the selection if I use selection_set then selection_clear but > i can't clear the selection when it's highlight with a mouse. > > Thanks, > Hani > ----- Original Message ---- > From: James Brotchie > To: Tkinter-discuss at python.org > Sent: Sunday, August 5, 2007 12:50:55 AM > Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection > > Hey Hani, > > Are you sure you are calling the selection_clear method of the hlist child > widget and not the parent tree? > > eg. > tree = Tix.Tree(root) > tree.hlist.selection_clear () > > If you look in Tix.py you can see that Tree is a compound widget > containing two scrollbars and a hlist. > > class Tree(TixWidget): > def __init__(self, master=None, cnf={}, **kw): > TixWidget.__init__(self, master, 'tixTree', > ['options'], cnf, kw) > self.subwidget_list ['hlist'] = _dummyHList(self, 'hlist') > self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') > self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') > > Thus to clear the hlist selection you must address the child hlist > directly and not its parent Tree widget. > > Cheers, > James > > On 8/5/07, hani abraham wrote: > > > Hi, > > > > I'm new to python and i'm using Tix Tree widget in my application. I'm > > trying to clear the tree selection but no luck so far. I tried > > selection_clear and anchor_clear but these aren't working. Can someone help? > > > > > > > > Thanks, > > Hani > > > > ------------------------------ > > Ask a question on any topic and get answers from real people. *Go to > > Yahoo! Answers.* > > > > _______________________________________________ > > Tkinter-discuss mailing list > > Tkinter-discuss at python.org > > http://mail.python.org/mailman/listinfo/tkinter-discuss > > > > > > > ------------------------------ > Be smarter than spam. See how smart SpamGuard is at giving junk email the > boot with the *All-new Yahoo! Mail * > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070805/38483614/attachment.htm From dmitry-gerasimov at yandex.ru Mon Aug 6 10:44:00 2007 From: dmitry-gerasimov at yandex.ru (Dmitry Gerasimov) Date: Mon, 06 Aug 2007 13:44:00 +0500 Subject: [Tkinter-discuss] Per-state option sintax in TkTreectrl In-Reply-To: <20070730202543.1e06c07b.klappnase@web.de> References: <20070730202543.1e06c07b.klappnase@web.de> Message-ID: Michael Lange wrote: > Hi Dmitry, > > I think you should use a tuple, like > > tree.style_layout(draw = ("yes", "open", "no", "")) > > I hope this helps > > Michael Hi Michael, Thank you for your advice. Acting upon it fixed the problem. Dmitry From abraham_h101 at yahoo.ca Mon Aug 6 23:57:04 2007 From: abraham_h101 at yahoo.ca (hani abraham) Date: Mon, 6 Aug 2007 14:57:04 -0700 (PDT) Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection Message-ID: <973706.30567.qm@web51906.mail.re2.yahoo.com> Your script works as expected and I think the problem in my script is a conflict when importing modules. The following are modules loaded order: from Tkinter import * from copy import copy, deepcopy import Tix import tkFileDialog import Tkinter as Tk Is there a way i can resolve the conflict between tkinter and tix without removing tkinter? Thanks, Hani ----- Original Message ---- From: James Brotchie To: hani abraham Cc: Tkinter-discuss at python.org Sent: Sunday, August 5, 2007 7:16:41 AM Subject: Re: [Tkinter-discuss] Fwd: Tix hlist-clearing selection Does this script function as expected on your installation? You should be able to select multiple items in the tree and then clear the selection with the button. Works for me on both winxp and ubuntu with 2.6trunk, 2.5maint and 2.4maint compiled against tcl8.4.12, tix-8.4.0, tk8.4.12. Which version of python and what tcl/tk/tix libraries are you using? cat hlisttest.py from Tix import * def clearSelection(hlist): hlist.selection_clear() tk = Tk() # create and configure tree tree = Tree(tk) tree.hlist['selectmode'] = EXTENDED tree.hlist['wideselection'] = TRUE tree.hlist['background'] = 'white' # add a couple of tree nodes tree.hlist.add("test1", text="Hello world") for i in range(5): tree.hlist.add_child("test1", text="item%d" % i) # add button for selection clear Button(tk, text="Clear Selection", command=lambda:clearSelection(tree.hlist)).pack() # pack tree tree.pack(expand=TRUE, fill=BOTH) tk.mainloop() On 8/5/07, hani abraham wrote: Yes, i used the hlist component of the tree but nothing happens. The thing is I can clear the selection if I use selection_set then selection_clear but i can't clear the selection when it's highlight with a mouse. Thanks, Hani ----- Original Message ---- From: James Brotchie < brotchie at gmail.com> To: Tkinter-discuss at python.org Sent: Sunday, August 5, 2007 12:50:55 AM Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection Hey Hani, Are you sure you are calling the selection_clear method of the hlist child widget and not the parent tree? eg. tree = Tix.Tree(root) tree.hlist.selection_clear () If you look in Tix.py you can see that Tree is a compound widget containing two scrollbars and a hlist. class Tree(TixWidget): def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixTree', ['options'], cnf, kw) self.subwidget_list ['hlist'] = _dummyHList(self, 'hlist') self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') Thus to clear the hlist selection you must address the child hlist directly and not its parent Tree widget. Cheers, James On 8/5/07, hani abraham < abraham_h101 at yahoo.ca> wrote: Hi, I'm new to python and i'm using Tix Tree widget in my application. I'm trying to clear the tree selection but no luck so far. I tried selection_clear and anchor_clear but these aren't working. Can someone help? Thanks, Hani Ask a question on any topic and get answers from real people. Go to Yahoo! Answers. _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail Get news delivered with the All new Yahoo! Mail. Enjoy RSS feeds right on your Mail page. Start today at http://mrd.mail.yahoo.com/try_beta?.intl=ca -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070806/30df8364/attachment.html From gerardo at computo-industrial.com.mx Tue Aug 7 17:08:30 2007 From: gerardo at computo-industrial.com.mx (Gerardo Juarez) Date: Tue, 7 Aug 2007 11:08:30 -0400 (EDT) Subject: [Tkinter-discuss] Trapping event for Toplevel() In-Reply-To: <973706.30567.qm@web51906.mail.re2.yahoo.com> Message-ID: Hi, I would like to know if there is a way to trap the kill button event in a Toplevel window. I'm having problems with a dialog which has a "Close" button, but users keep closing it with the kill button (the big X at the upper right corner). After such a close, the application refuses to re-open the dialog, throwing instead an exception: File "C:\PYTHON24\lib\lib-tk\Tkinter.py", line 1541, in wm_withdraw return self.tk.call('wm', 'withdraw', self._w) TclError: bad window path name ".14221680" My guess is that I must trap the kill event as well but I don't know how to do it. Gerardo From Cameron at phaseit.net Tue Aug 7 19:54:16 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Tue, 7 Aug 2007 17:54:16 +0000 Subject: [Tkinter-discuss] Trapping event for Toplevel() In-Reply-To: References: <973706.30567.qm@web51906.mail.re2.yahoo.com> Message-ID: <20070807175416.GA10964@lairds.us> On Tue, Aug 07, 2007 at 11:08:30AM -0400, Gerardo Juarez wrote: . . . > I would like to know if there is a way to trap the kill button event in a > Toplevel window. I'm having problems with a dialog which has a "Close" > button, but users keep closing it with the kill button (the big X at the > upper right corner). After such a close, the application refuses to > re-open the dialog, throwing instead an exception: > > File "C:\PYTHON24\lib\lib-tk\Tkinter.py", line 1541, in wm_withdraw > return self.tk.call('wm', 'withdraw', self._w) > TclError: bad window path name ".14221680" > > My guess is that I must trap the kill event as well but I don't know how > to do it. . . . Read about WM_DELETE_WINDOW in or . From c_karaca2 at yahoo.com Wed Aug 8 14:42:58 2007 From: c_karaca2 at yahoo.com (c.karaca) Date: Wed, 8 Aug 2007 05:42:58 -0700 (PDT) Subject: [Tkinter-discuss] work to Different frames but in same window Message-ID: <422409.30728.qm@web51806.mail.re2.yahoo.com> Hi, I new user in Python. I have development a simple project.This project have three menus. I want to new window but in root frame when click menus.Other ways, firstly root window clear and then new label entry etc.widgets be loacated in same window. I hope , you give me example codes.. best regards --------------------------------- Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070808/a001e442/attachment.htm From gerardo at computo-industrial.com.mx Wed Aug 8 17:37:52 2007 From: gerardo at computo-industrial.com.mx (Gerardo Juarez) Date: Wed, 8 Aug 2007 11:37:52 -0400 (EDT) Subject: [Tkinter-discuss] Trapping event for Toplevel() In-Reply-To: <20070807175416.GA10964@lairds.us> Message-ID: Thanks, it's exactly what I needed. Gerardo On Tue, 7 Aug 2007, Cameron Laird wrote: > On Tue, Aug 07, 2007 at 11:08:30AM -0400, Gerardo Juarez wrote: > . > . > . > > I would like to know if there is a way to trap the kill button event in a > > Toplevel window. I'm having problems with a dialog which has a "Close" > > button, but users keep closing it with the kill button (the big X at the > > upper right corner). After such a close, the application refuses to > > re-open the dialog, throwing instead an exception: > > > > File "C:\PYTHON24\lib\lib-tk\Tkinter.py", line 1541, in wm_withdraw > > return self.tk.call('wm', 'withdraw', self._w) > > TclError: bad window path name ".14221680" > > > > My guess is that I must trap the kill event as well but I don't know how > > to do it. > . > . > . > Read about WM_DELETE_WINDOW in http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm > > or http://www.astro.washington.edu/owen/TkinterSummary.html#ProtocolHandler >. > From Cameron at phaseit.net Thu Aug 16 19:51:55 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Thu, 16 Aug 2007 17:51:55 +0000 Subject: [Tkinter-discuss] Getting labels from a Text field In-Reply-To: <019801c71caa$089f63b0$2d1a8a81@workblab> References: <019801c71caa$089f63b0$2d1a8a81@workblab> Message-ID: <20070816175155.GA10519@lairds.us> On Sun, Dec 10, 2006 at 03:25:00PM -0700, Bob Greschke wrote: . . . > Re: [Tkinter-discuss] Tkinter-discuss Digest, Vol 34, Issue 5I have a "form" in my program that has a Text() field with a little text, some Buttons with pictures, and some Labels inserted into it. If I just do a Text().get(0.0, END) all I get is the text. Is there a way to get, pardon my C, a pointer to the Labels so I can cget the text from them? > > A picture of my form: www.greschke.com/unlinked/images/getem.jpg > > I specifically want the 7-digit number in the light blue areas (the Labels). I can keep a list of the numbers as I insert the Labels, but the user may edit some of them out of the list (like with the keyboard), so then my list wouldn't match. . . . I like the JPEG; it's always a treat to see how Tkinter helps folks. I apologize for letting this request languish so long. While I shan't make the time now to recode your application, I believe the answer you sought is something like this: you probably did a my_label = Tkinter.Label(text = "See me?") my_label_instance = window_create(index, window = my_label) (see ) to insert the Label. The return value from window_create() will be a "Tkinter.Label instance"; you can just my_label_instance.cget("text") at that point. From strudwickthomas at yahoo.com Fri Aug 24 06:10:18 2007 From: strudwickthomas at yahoo.com (PatT) Date: Thu, 23 Aug 2007 21:10:18 -0700 (PDT) Subject: [Tkinter-discuss] TkInter LabelEntry Message-ID: <12306089.post@talk.nabble.com> When I run the code below, the data is the second entry box is invisible because the Entry widget is disabled. How can I see the data, but keep the disabled attribute? from Tix import * root = Tk() frame = Frame(root) labent1 = LabelEntry(frame, label="A", labelside = 'left', options = ''' entry.width 40 ''') labent1.entry['background'] = 'gray90' labent1.entry.insert('end', "AAA") labent1['state'] = 'normal' labent1.grid(column=0, sticky=E) labent2 = LabelEntry(frame, label="B", labelside = 'left', disabledforeground = 'red', options = 'entry.width 40') labent2.entry['background'] = 'gray90' labent2['state'] = 'disabled' labent2.entry.insert('end', "BBB") labent2.grid(column=0, sticky=E) frame.grid() frame.mainloop() -- View this message in context: http://www.nabble.com/TkInter-LabelEntry-tf4321384.html#a12306089 Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From johnmc at velseis.com.au Sat Aug 25 12:42:30 2007 From: johnmc at velseis.com.au (John McMonagle) Date: Sat, 25 Aug 2007 20:42:30 +1000 Subject: [Tkinter-discuss] TkInter LabelEntry In-Reply-To: <12306089.post@talk.nabble.com> References: <12306089.post@talk.nabble.com> Message-ID: <20070825104202.M96868@velseis.com.au> Do the insert BEFORE you do disable the entry. From Cameron at phaseit.net Sat Aug 25 23:28:09 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Sat, 25 Aug 2007 21:28:09 +0000 Subject: [Tkinter-discuss] TkInter LabelEntry In-Reply-To: <20070825104202.M96868@velseis.com.au> References: <12306089.post@talk.nabble.com> <20070825104202.M96868@velseis.com.au> Message-ID: <20070825212809.GA30074@lairds.us> On Sat, Aug 25, 2007 at 08:42:30PM +1000, John McMonagle wrote: . . . > Do the insert BEFORE you do disable the entry. . . . In fact, there are applications that rely on a pattern of enable the entry update its display re-disable the entry for programmatic updates. From bob at passcal.nmt.edu Tue Aug 28 21:30:02 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Tue, 28 Aug 2007 13:30:02 -0600 Subject: [Tkinter-discuss] Checkbutton variable type In-Reply-To: <10844147.post@talk.nabble.com> References: <10329262.post@talk.nabble.com> <20070528144034.GA20924@lairds.us> <10844147.post@talk.nabble.com> Message-ID: <72E5E01D-1B1F-4A9A-A284-7A0491AFC18D@passcal.nmt.edu> The Checkbutton widget Var = IntVar() Checkbutton(Frm, text = "Destroy", variable = Var) wants Var to be an IntVar, but it also works if Var is a StringVar and you set() Var to "0" and "1". Is there a possibility that this will be "fixed" some time in the future, or would it be safe to keep Var as a StringVar, or is it not even really broken (I don't know Tcl/ Tk which I assume is allowing this?)? In my case it would be nice to keep "0" or "1" in a MySQL database column and have a Tkinter form with a Checkbutton do the right thing without having to change the column to an int, or keep converting back and forth between chars and ints for that one column to keep from running into trouble in the future. Thanks! Bob From klappnase at web.de Wed Aug 29 10:37:05 2007 From: klappnase at web.de (Michael Lange) Date: Wed, 29 Aug 2007 10:37:05 +0200 Subject: [Tkinter-discuss] Checkbutton variable type In-Reply-To: <72E5E01D-1B1F-4A9A-A284-7A0491AFC18D@passcal.nmt.edu> References: <10329262.post@talk.nabble.com> <20070528144034.GA20924@lairds.us> <10844147.post@talk.nabble.com> <72E5E01D-1B1F-4A9A-A284-7A0491AFC18D@passcal.nmt.edu> Message-ID: <20070829103705.1208dcc0.klappnase@web.de> On Tue, 28 Aug 2007 13:30:02 -0600 Bob Greschke wrote: > The Checkbutton widget > > Var = IntVar() > Checkbutton(Frm, text = "Destroy", variable = Var) > > wants Var to be an IntVar, but it also works if Var is a StringVar > and you set() Var to "0" and "1". Is there a possibility that this > will be "fixed" some time in the future, or would it be safe to keep > Var as a StringVar, or is it not even really broken (I don't know Tcl/ > Tk which I assume is allowing this?)? In my case it would be nice to > keep "0" or "1" in a MySQL database column and have a Tkinter form > with a Checkbutton do the right thing without having to change the > column to an int, or keep converting back and forth between chars and > ints for that one column to keep from running into trouble in the > future. > Hi Bob, I am not a tcler myself, but I think the integers are being converted to strings anyway when they are passed to tcl, so 1 and "1" might be equivalent here. If you want to be even more safe, you might want to use the checkbutton's onvalue and offvalue options, like onvalue="1", offvalue="0" . Michael From hmg_u at yahoo.co.in Wed Aug 29 08:37:49 2007 From: hmg_u at yahoo.co.in (tuxfood) Date: Tue, 28 Aug 2007 23:37:49 -0700 (PDT) Subject: [Tkinter-discuss] sqlite3 operational error with tkinter Message-ID: <12381457.post@talk.nabble.com> Hi. I am writing a small questionnaire application. I am using sqlite3 and tkinter + python. I started off by writing a console application. The application queries a db file i created . But while using in the gui application i am getting an error that a column cannot be decoded into UTF-8. Is this a problem with the DB file? or has this got to do something with tkinter? I am attaching the source code too. thanks tuxfood http://www.nabble.com/file/p12381457/gui.py gui.py -- View this message in context: http://www.nabble.com/sqlite3-operational-error-with-tkinter-tf4345961.html#a12381457 Sent from the Python - tkinter-discuss mailing list archive at Nabble.com. From ronpro at cox.net Wed Aug 29 21:54:46 2007 From: ronpro at cox.net (Ron Provost) Date: Wed, 29 Aug 2007 15:54:46 -0400 Subject: [Tkinter-discuss] Tix HList missing at least one method Message-ID: <002f01c7ea76$751bdfb0$6501a8c0@aristotle> According to the Tix documentation online, HList has an info_bbox() method which returns the bounding box of a given item in the HList. However, when I try to call this method, I get an attribute error. Looking at Tix.py I see that info_bbox() is not implemented. Hazarding a chance (mostly by looking at the other method implementation) I see if I can define it myself. def info_bbox( self, entry ): return [ int(pos) for pos in self.tk.call( self._w, 'info', 'bbox', entry).split() ] When I use this implementation it works. Why's info_bbox() been left out of HList? I can't formulate a work-around for what I'm trying to do. I need info_bbox(). Here's why: I'm currently working on a project which involves some fairly complex GUIs. It displays data in the form of an outline which the user can edit, it also generates web pages. To allow a natural feel to editing the order of the items in the outline, I decided to make use of the Tkinter drag and drop module: Tkdnd. To do this correctly, I need to do a bit of arithmetic with screen coordinates while in a drag operation (so I can change the cursor during the drag) so that I can determine if my current drag position (potential drop position) is above, below or as a child of some other item in the outline. The easiest way to do this is to get the bounding box of the nearest items. Thanks, Ron -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20070829/eaf3b8a8/attachment.htm From bob at passcal.nmt.edu Wed Aug 29 22:30:11 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Wed, 29 Aug 2007 14:30:11 -0600 Subject: [Tkinter-discuss] Checkbutton variable type In-Reply-To: <20070829103705.1208dcc0.klappnase@web.de> References: <10329262.post@talk.nabble.com> <20070528144034.GA20924@lairds.us> <10844147.post@talk.nabble.com> <72E5E01D-1B1F-4A9A-A284-7A0491AFC18D@passcal.nmt.edu> <20070829103705.1208dcc0.klappnase@web.de> Message-ID: <44B0CB04-CFA8-45AD-9F5A-68FE311E74CA@passcal.nmt.edu> > On Tue, 28 Aug 2007 13:30:02 -0600 > Bob Greschke wrote: > >> The Checkbutton widget >> >> Var = IntVar() >> Checkbutton(Frm, text = "Destroy", variable = Var) >> >> wants Var to be an IntVar, but it also works if Var is a StringVar >> and you set() Var to "0" and "1". Is there a possibility that this >> will be "fixed" some time in the future, or would it be safe to keep >> Var as a StringVar, or is it not even really broken (I don't know >> Tcl/ >> Tk which I assume is allowing this?)? In my case it would be nice to >> keep "0" or "1" in a MySQL database column and have a Tkinter form >> with a Checkbutton do the right thing without having to change the >> column to an int, or keep converting back and forth between chars and >> ints for that one column to keep from running into trouble in the >> future. >> > On Aug 29, 2007, at 02:37, Michael Lange wrote: > Hi Bob, > > I am not a tcler myself, but I think the integers are being > converted to strings > anyway when they are passed to tcl, so 1 and "1" might be > equivalent here. > If you want to be even more safe, you might want to use the > checkbutton's > onvalue and offvalue options, like onvalue="1", offvalue="0" . onvalue?! offvalue??!! Every time I look in Grayson's Python and Tkinter programming I DON'T see something. :) I never even knew those existed and I must have looked at that section 100 times over the years. Thanks! Bob From malsburg at cl.uni-heidelberg.de Thu Aug 30 12:38:49 2007 From: malsburg at cl.uni-heidelberg.de (Titus von der Malsburg) Date: Thu, 30 Aug 2007 12:38:49 +0200 Subject: [Tkinter-discuss] resize notification Message-ID: <20070830103848.GC1840@(none)> I have a canvas and have to perform some action when it is resized. How can I get notified when resizing happened? How do I find out the amount of the change (without keeping the old size myself)? I tried overriding config (configure), but it is not called during resizing. Thanks for any advice! Titus From Cameron at phaseit.net Thu Aug 30 16:07:16 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Thu, 30 Aug 2007 14:07:16 +0000 Subject: [Tkinter-discuss] sqlite3 operational error with tkinter In-Reply-To: <12381457.post@talk.nabble.com> References: <12381457.post@talk.nabble.com> Message-ID: <20070830140716.GA2303@lairds.us> On Tue, Aug 28, 2007 at 11:37:49PM -0700, tuxfood wrote: . . . > I am writing a small questionnaire application. I am using sqlite3 and > tkinter + python. I started off by writing a console application. The > application queries a db file i created . But while using in the gui > application i am getting an error that a column cannot be decoded into > UTF-8. Is this a problem with the DB file? or has this got to do something > with tkinter? I am attaching the source code too. . . . ? What's the exact diagnostic message, and which statement yields it? From Cameron at phaseit.net Thu Aug 30 16:24:24 2007 From: Cameron at phaseit.net (Cameron Laird) Date: Thu, 30 Aug 2007 14:24:24 +0000 Subject: [Tkinter-discuss] resize notification In-Reply-To: <20070830103848.GC1840@(none)> References: <20070830103848.GC1840@(none)> Message-ID: <20070830142424.GA7124@lairds.us> On Thu, Aug 30, 2007 at 12:38:49PM +0200, Titus von der Malsburg wrote: . . . > I have a canvas and have to perform some action when it is resized. How > can I get notified when resizing happened? How do I find out the amount > of the change (without keeping the old size myself)? > > I tried overriding config (configure), but it is not called during > resizing. . . . Is the sort of thing you're after? Note the spelling: "". From bob at passcal.nmt.edu Thu Aug 30 17:15:51 2007 From: bob at passcal.nmt.edu (Bob Greschke) Date: Thu, 30 Aug 2007 09:15:51 -0600 Subject: [Tkinter-discuss] resize notification In-Reply-To: <20070830142424.GA7124@lairds.us> References: <20070830103848.GC1840@(none)> <20070830142424.GA7124@lairds.us> Message-ID: I've found that the generation of the can also change from OS to OS, and from system to system with the same OS. Tkinter on Windows seems to only generate the when you are finished resizing (which may or may not be what you want), and some Linux/Solaris/OSX systems generate it (a lot) while you are moving the mouse (which may or may not be what you want). I don't know how to change it, but I think generating the while the mouse is moving may be a configuration option of X11, so you may have to allow for either case. Bob On Aug 30, 2007, at 08:24, Cameron Laird wrote: > On Thu, Aug 30, 2007 at 12:38:49PM +0200, Titus von der Malsburg > wrote: > . > . > . >> I have a canvas and have to perform some action when it is >> resized. How >> can I get notified when resizing happened? How do I find out the >> amount >> of the change (without keeping the old size myself)? >> >> I tried overriding config (configure), but it is not called during >> resizing. > . > . > . > Is 424098.html > > the sort of thing you're after? Note the spelling: "". > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss From klappnase at web.de Fri Aug 31 10:05:05 2007 From: klappnase at web.de (Michael Lange) Date: Fri, 31 Aug 2007 10:05:05 +0200 Subject: [Tkinter-discuss] Tix HList missing at least one method In-Reply-To: <002f01c7ea76$751bdfb0$6501a8c0@aristotle> References: <002f01c7ea76$751bdfb0$6501a8c0@aristotle> Message-ID: <20070831100505.499fd076.klappnase@web.de> On Wed, 29 Aug 2007 15:54:46 -0400 "Ron Provost" wrote: > According to the Tix documentation online, HList has an info_bbox() method which returns the bounding box of a given item in the HList. However, when I try to call this method, I get an attribute error. Looking at Tix.py I see that info_bbox() is not implemented. > > Hazarding a chance (mostly by looking at the other method implementation) I see if I can define it myself. > > def info_bbox( self, entry ): > return [ int(pos) for pos in self.tk.call( self._w, 'info', 'bbox', entry).split() ] > > When I use this implementation it works. Why's info_bbox() been left out of HList? > Hi Ron, this is not much of a surprise to me, there are more things missing from the Tix module. Probably it is the best to use your "private" Tix module with the added info_bbox() method. If you like you can send a patch to the python developers to fix this. BTW, maybe there is a bug in your implementation of info_bbox(), it will fail if the tcl method returns an empty string which might happen if the named item does not exist or so. You better use self._getints() as in Tkinter.Canvas.bbox() : def info_bbox( self, entry ): return self._getints(self.tk.call(self._w, ?info?, 'bbox', entry)) or None I hope this helps Michael From pytkvtk at gmail.com Fri Aug 31 12:09:52 2007 From: pytkvtk at gmail.com (Olivier Feys) Date: Fri, 31 Aug 2007 12:09:52 +0200 Subject: [Tkinter-discuss] Tkinter on windows-x84-64 Message-ID: <46D7E8F0.4060904@gmail.com> hi all, I have a patched version of python based on last svn version flagged 2.6 I'm trying to port my application on windows-x86-64. do I need a 64 bits distribution of tcl/tk to build _tkinter.pyd ? In the latest distribution of python(2.5) for win64, is the included tcl/tk distribution 64 bits ? Thanks for help Olivier