Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
> It seems that this could be handled fairly straight-forwardly by subclassing either Listbox or Frame to implement your own, custom widget. I will freely admit that I am far from facile with Tk widgets. I've been using GTK for most GUI apps for a long while (when I need to write such things), but

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Jason Swails
On Thu, Oct 10, 2013 at 2:29 PM, Skip Montanaro wrote: > > Removing inappropriate entries is not much of a hack. > > True, but then I have to go through the trouble of adding them back in > should they become valid again. :-) > It seems that this could be handled fairly straight-forwardly by sub

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
> Removing inappropriate entries is not much of a hack. True, but then I have to go through the trouble of adding them back in should they become valid again. :-) Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Chris “Kwpolska” Warrick
On Thu, Oct 10, 2013 at 4:37 PM, Skip Montanaro wrote: > Thanks. "disabled" did the trick. Turns out you can't disable > individual items. Instead, you have to (hackishly) change the display > of entries somehow to indicate their inappropriateness... Removing inappropriate entries is not much of

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
> Other synonyms from GUI toolkits are "inactive" and "disabled". I > don't know if that'll be any help though. Thanks. "disabled" did the trick. Turns out you can't disable individual items. Instead, you have to (hackishly) change the display of entries somehow to indicate their inappropriateness

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Chris Angelico
On Fri, Oct 11, 2013 at 12:50 AM, Skip Montanaro wrote: > Does Tk > perhaps use a word other than "insensitive" to describe an item which > you'd normally be able to click? Other synonyms from GUI toolkits are "inactive" and "disabled". I don't know if that'll be any help though. ChrisA -- http

How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Skip Montanaro
I have a pair of Listboxes, each with ranges of the same text. For example: ABCABC DEFDEF GHIGHI JKLJKL (My apologies, I'm sure Gmail is going to butcher that.) If I select "ABC" from the first list, only the last three values in the second list are appropriate selections. Is th

Re: How to configure Tkinter Listbox to disable state keeping selected item highlighted

2012-07-18 Thread Rick Johnson
On Tuesday, July 17, 2012 8:55:21 AM UTC-5, Sarbjit singh wrote: > I am having a problem configuring a listbox widget such that the selection > remains highlighted even while it is set (programmatically) to the DISABLED > state. Below code shows the problem: > > from Tkinter import * > master =

Re: How to configure Tkinter Listbox to disable state keeping selected item highlighted

2012-07-17 Thread inq1ltd
On Tuesday, July 17, 2012 06:55:21 AM Sarbjit singh wrote: > I am having a problem configuring a listbox widget such that the selection > remains highlighted even while it is set (programmatically) to the DISABLED > state. Below code shows the problem: > > from Tkinter import * > master = Tk() >

How to configure Tkinter Listbox to disable state keeping selected item highlighted

2012-07-17 Thread Sarbjit singh
I am having a problem configuring a listbox widget such that the selection remains highlighted even while it is set (programmatically) to the DISABLED state. Below code shows the problem: from Tkinter import * master = Tk() listbox = Listbox(master) listbox.pack() listbox.insert(END, "Text1")

python tkinter Listbox

2010-09-14 Thread Von
Hi all, I am building a simple tool using tkinter,and need multiselection checklist.I find that Listbox with option selectmode=tkinter.MULTIPLE could do this for me. But when I have two Listboxs,I do some selection with one,then do selection with another one,the previous listbox get cleared.I wo

Re: tkInter Listbox question

2010-06-22 Thread eb303
On Jun 21, 6:36 pm, rantingrick wrote: > On Jun 21, 12:36 am, Anthony Papillion wrote: > > > So I'm trying to add a Listbox to my window. I want it to be the width > > of my window and the height of my window.  I'm using the following > > code ('root' is my toplevel window): > > > gsItems = Listb

Re: tkInter Listbox question

2010-06-21 Thread Anthony Papillion
Thank you, RantingRick and EB303. Much appreciated and it looks like it works fine now. Still learning but I am amazed every single day how simple Python is! Thanks Again, Anthony Papillion -- http://mail.python.org/mailman/listinfo/python-list

Re: tkInter Listbox question

2010-06-21 Thread rantingrick
On Jun 21, 12:36 am, Anthony Papillion wrote: > So I'm trying to add a Listbox to my window. I want it to be the width > of my window and the height of my window.  I'm using the following > code ('root' is my toplevel window): > > gsItems = Listbox(root, width=root.winfo_width(), > height=root.win

Re: tkInter Listbox question

2010-06-21 Thread eb303
On Jun 21, 7:36 am, Anthony Papillion wrote: > So I'm trying to add a Listbox to my window. I want it to be the width > of my window and the height of my window.  I'm using the following > code ('root' is my toplevel window): > > gsItems = Listbox(root, width=root.winfo_width(), > height=root.winf

tkInter Listbox question

2010-06-20 Thread Anthony Papillion
So I'm trying to add a Listbox to my window. I want it to be the width of my window and the height of my window. I'm using the following code ('root' is my toplevel window): gsItems = Listbox(root, width=root.winfo_width(), height=root.winfo_height()) gsItems.pack() While you would think this co

Re: Display file names in Tkinter Listbox

2010-05-20 Thread sit
On Fri, 21 May 2010 08:02:30 +1000, John McMonagle wrote: >s...@home.com wrote: > >> I have made the modifications and it does print inside the listbox, >> however they are all printed on the same line. >> > >Sorry, I didn't realize askopenfilenames returned the filenames as a >whitespace sepa

Re: Display file names in Tkinter Listbox

2010-05-20 Thread John McMonagle
s...@home.com wrote: > I have made the modifications and it does print inside the listbox, > however they are all printed on the same line. > Sorry, I didn't realize askopenfilenames returned the filenames as a whitespace separated string, on my system they are returned as a tuple of strings.

Re: Display file names in Tkinter Listbox

2010-05-20 Thread sit
On Thu, 20 May 2010 15:36:59 +1000, John McMonagle wrote: >r...@home.com wrote: >> Hello, >> >> My first attenpt at a simple python Tkinter application. I wanted to >> see how to load file names into a listbox from a menu. This is what I >> got until the part of displaying the file names in a l

Re: Display file names in Tkinter Listbox

2010-05-19 Thread John McMonagle
r...@home.com wrote: > Hello, > > My first attenpt at a simple python Tkinter application. I wanted to > see how to load file names into a listbox from a menu. This is what I > got until the part of displaying the file names in a listbox, which I > could not figfure out how to do? > > Any help w

Display file names in Tkinter Listbox

2010-05-19 Thread Rick
Hello, My first attenpt at a simple python Tkinter application. I wanted to see how to load file names into a listbox from a menu. This is what I got until the part of displaying the file names in a listbox, which I could not figfure out how to do? Any help would be appreciated. Trying to do thi

Re: Sample code usable Tkinter listbox

2010-03-06 Thread rantingrick
Opps: found a few errors in that last ScrolledListbox class, try this one... import Tkinter as tk from Tkconstants import * class ScrolledList(tk.Listbox): def __init__(self, master, **kw): self.frame = tk.Frame(master) self.frame.rowconfigure(0, weight=1) self.frame

Re: Sample code usable Tkinter listbox

2010-03-03 Thread Alf P. Steinbach
* Alf P. Steinbach: In case Someone Else(TM) may need this. This code is just how it currently looks, what I needed for my code, so it's not a full-fledged or even tested class. But it works. That code evolved a little to cover more Tk listbox quirks (thanks to Ratingrick for the "actives

Re: Sample code usable Tkinter listbox

2010-03-01 Thread rantingrick
On Mar 1, 6:19 am, "Alf P. Steinbach" wrote: > >         kw.setdefault('activestyle', 'none') > > Hm, let me steal this line... Thanks! Yes! the default activestyle is quite annoying! -- http://mail.python.org/mailman/listinfo/python-list

Re: Sample code usable Tkinter listbox

2010-03-01 Thread Alf P. Steinbach
* rantingrick: kw.setdefault('activestyle', 'none') Hm, let me steal this line... Thanks! Cheers, - Alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Sample code usable Tkinter listbox

2010-02-28 Thread rantingrick
On Feb 28, 9:57 pm, "Alf P. Steinbach" wrote: > * rantingrick: I just hate overriding all the paths to each listbox method. How about just overideing the Listboxe's geomerty methods once an your done? #-- start script --# import Tkinter as tk from Tkconstants import * import tkMessageBox as MB

Re: Sample code usable Tkinter listbox

2010-02-28 Thread Alf P. Steinbach
outside their bounding box. I guess that could be fixed up somehow by overriding this and that, but I find it simpler to just make the enclosing widget the widget that one has a reference to. And in a way it's also good that it's more laborious to directly access the tkinter listbox s

Re: Sample code usable Tkinter listbox

2010-02-28 Thread rantingrick
On Feb 28, 6:30 pm, "Alf P. Steinbach" wrote: > In case Someone Else(TM) may need this. > > This code is just how it currently looks, what I needed for my code, so it's > not > a full-fledged or even tested class. Thanks for sharing Alf, Thats works fine "as-is" but what about inheriting from "t

Sample code usable Tkinter listbox

2010-02-28 Thread Alf P. Steinbach
In case Someone Else(TM) may need this. This code is just how it currently looks, what I needed for my code, so it's not a full-fledged or even tested class. But it works. import tkinter as t import tkinter.simpledialog import tkinter.messagebox t.askstring = tkinter.simpledialog.askstr

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-31 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > On May 29, 2:02 pm, [EMAIL PROTECTED] wrote: > > Hi, > > Is it possible to havedifferentitems in alistboxindifferentcolors? Or is it justonecolor for all items in alistbox? > > Thanks > > Rahul > > from Tkinter import * > > root = Tk() > l = Listbox(root) > l.pack()

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-30 Thread rahulnag22
On May 30, 6:04 am, [EMAIL PROTECTED] wrote: > On May 29, 2:02 pm, [EMAIL PROTECTED] wrote: > > > Hi, > > Is it possible to havedifferentitems in alistboxindifferentcolors? Or is it > > justonecolor for all items in alistbox? > > Thanks > > Rahul > > from Tkinter import * > > root = Tk() > l = Lis

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-30 Thread rfg007
On May 29, 2:02 pm, [EMAIL PROTECTED] wrote: > Hi, > Is it possible to havedifferentitems in alistboxindifferentcolors? Or is it > justonecolor for all items in alistbox? > Thanks > Rahul from Tkinter import * root = Tk() l = Listbox(root) l.pack() for x in range(10): l.insert(END, x) l.item

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-30 Thread Eric Brunel
On Tue, 29 May 2007 19:02:03 +0200, <[EMAIL PROTECTED]> wrote: > Hi, > Is it possible to have different items in a listbox in different > colors? Or is it just one color for all items in a listbox? > Thanks > Rahul > AFAIK, this is not possible with a listbox. You can however quite easily emula

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-30 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > Hi, > Is it possible to have different items in a listbox in different > colors? Or is it just one color for all items in a listbox? > Thanks > Rahul You specify text and foreground colour when you make the box, so I don't think its possible. - Hendrik -- http://

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-29 Thread kyosohma
On May 29, 12:02 pm, [EMAIL PROTECTED] wrote: > Hi, > Is it possible to have different items in a listbox in different > colors? Or is it just one color for all items in a listbox? > Thanks > Rahul Looks like it has to be the same color and font: http://www.pythonware.com/library/tkinter/introduct

Tkinter Listbox - Different Text colors in one listbox

2007-05-29 Thread rahulnag22
Hi, Is it possible to have different items in a listbox in different colors? Or is it just one color for all items in a listbox? Thanks Rahul -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter listbox

2007-04-25 Thread Gigs_
Gigs_ wrote: > I have two listbox on frame, and at same time i need to use one option > from both listbox. But when I click on first than on second listbox > first get deselected. > > How to make this? Is it possiblE? i found, just need to use exportselection=0 -- http://mail.python.org/mailman

Re: tkinter listbox

2007-04-25 Thread Gigs_
I have two listbox on frame, and at same time i need to use one option from both listbox. But when I click on first than on second listbox first get deselected. How to make this? Is it possiblE? -- http://mail.python.org/mailman/listinfo/python-list

tkinter listbox

2007-04-25 Thread Gigs_
Hi! Im working on paint program with tkinter canvas. I have two listbox and when i click on first listbox second become deselected. I need to take one thing from first listbox and one thing from second at the same time. How to do that? thx, apologies for bad english -- http://mail.python.org/

Re: osx tkinter listbox problem

2007-03-26 Thread Ben Collver
James Stroud wrote: > A "cross platform" work-around might be to grid a frame at the row and > column of self.Main and pack the Listbox into the Frame. I don't have a > Mac at work to test this, however. But I would be curious to know your > results if you try it. Thank you for the sub-frame su

Re: osx tkinter listbox problem

2007-03-26 Thread James Stroud
Ben Collver wrote: > I am using Darwin 10.4.9, tcl 8.4.7, tk 8.4, and python 2.3.5. I have > also tried Python 2.5 on Darwin, Debian, and Fedora Core 6. > > I am working on a GUI front-end to a Python program of mine. It is a > simple grid with labels in the left column and input widgets in th

osx tkinter listbox problem

2007-03-26 Thread Ben Collver
I am using Darwin 10.4.9, tcl 8.4.7, tk 8.4, and python 2.3.5. I have also tried Python 2.5 on Darwin, Debian, and Fedora Core 6. I am working on a GUI front-end to a Python program of mine. It is a simple grid with labels in the left column and input widgets in the right column. One of the

Re: attaching Tkinter Listbox to python list object

2007-03-12 Thread jim-on-linux
On Monday 12 March 2007 20:34, Steve Potter wrote: > I am trying to find some method of attaching a > Listbox object to a list object so as the > contents of the list are changed the contents > of the Listbox will be updated to match. I > have found a few references to something like > this in thi

Re: attaching Tkinter Listbox to python list object

2007-03-12 Thread James Stroud
Steve Potter wrote: > I am trying to find some method of attaching a Listbox object to a > list object so as the contents of the list are changed the contents of > the Listbox will be updated to match. I have found a few references > to something like this in this old post > http://groups.google.c

attaching Tkinter Listbox to python list object

2007-03-12 Thread Steve Potter
I am trying to find some method of attaching a Listbox object to a list object so as the contents of the list are changed the contents of the Listbox will be updated to match. I have found a few references to something like this in this old post http://groups.google.com/group/comp.lang.python/brow

Re: Retrieve Tkinter listbox item by string, not by index

2006-12-23 Thread Godson
On 12/23/06, Kevin Walzer <[EMAIL PROTECTED]> wrote: I'm trying to set the active item in a Tkinter listbox to my application's currently-defined default font. Here's how I get the fonts loaded into the listbox: self.fonts=list(tkFont.families()) self.fonts.s

Re: Retrieve Tkinter listbox item by string, not by index

2006-12-22 Thread Hendrik van Rooyen
"Kevin Walzer" <[EMAIL PROTECTED]> wrote: > I'm trying to set the active item in a Tkinter listbox to my > application's currently-defined default font. not sure if you can mix fonts in a listbox - the font option when you create the listbox instance seems to

Re: Retrieve Tkinter listbox item by string, not by index

2006-12-22 Thread James Stroud
James Stroud wrote: > Kevin Walzer wrote: > >> I'm trying to set the active item in a Tkinter listbox to my >> application's currently-defined default font. >> >> Here's how I get the fonts loaded into the listbox: >> >> self.fonts=list(

Re: Retrieve Tkinter listbox item by string, not by index

2006-12-22 Thread James Stroud
Kevin Walzer wrote: > I'm trying to set the active item in a Tkinter listbox to my > application's currently-defined default font. > > Here's how I get the fonts loaded into the listbox: > > self.fonts=list(tkFont.families()) > self.fonts.

Retrieve Tkinter listbox item by string, not by index

2006-12-22 Thread Kevin Walzer
I'm trying to set the active item in a Tkinter listbox to my application's currently-defined default font. Here's how I get the fonts loaded into the listbox: self.fonts=list(tkFont.families()) self.fonts.sort() for item in self.fonts: self.fontlist.i

Re: Tkinter Listbox string formatting question - how to kill a dancingsnake ?

2006-11-02 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: In the meantime, I have produced this evil hack, that takes advantage of the difference in pixel widths between the space, and either the fullstop or the single quote... It will only work if you have quite a lot of space to waste between columns, an

Re: Tkinter Listbox string formatting question - how to kill adancingsnake ?

2006-10-31 Thread Hendrik van Rooyen
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > > instead of trying to force the listbox to behave like a multicolumn > > widget, maybe you could switch to another widget? some alternatives include > > > > a Text widget (you have to roll your

Re: Tkinter Listbox string formatting question - how to kill a dancingsnake ?

2006-10-31 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > instead of trying to force the listbox to behave like a multicolumn > widget, maybe you could switch to another widget? some alternatives include > > a Text widget (you have to roll your own selection logic) I _really_ don't feel strong enough

Re: Tkinter Listbox string formatting question - how to kill a dancing snake ?

2006-10-31 Thread Fredrik Lundh
Hendrik van Rooyen wrote: > Is there a way to format this so it will line up with *any* font ? > > I would prefer not to give up and use a fixed width font - it looks so > teletypish... sounds like contradicting requirements to me. instead of trying to force the listbox to behave like a multi

Tkinter Listbox string formatting question - how to kill a dancing snake ?

2006-10-30 Thread Hendrik van Rooyen
I am populating a listbox from a directory that looks like this: variable_dict = {"funny_long_or_short_variable_name_as_key": (2,45),.. the tuple represents a "card, line" pair. medf is a font object and a forward reference here. I write: for x in variable_dict: txt = x while medf.m

Re: Tkinter listbox and ftputil

2006-09-03 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote by email: Please keep it on the list... | Hi, | Hi and Thanks for all your help,everything work.But I have one | question,in string I am "new",and I don't know how to exactly split: | | example: | | '-rw-r--r-- 1 [EMAIL PROTECTED] | v-programs.byethost31.com 2376

Re: Tkinter listbox and ftputil

2006-09-02 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: | Hi, | Again I need help about tkinter listbox. | | | example: | | In listbox must write (imaginary file in server): | | ['-rw-r--r-- 1 [EMAIL PROTECTED] vedran.byethost12.com | 3506 Jun 25 14:40 file.gif'] | | | and then when somebody click on

Tkinter listbox and ftputil

2006-09-01 Thread vedran_dekovic
Hi, Again I need help about tkinter listbox. example: In listbox must write (imaginary file in server): ['-rw-r--r-- 1 [EMAIL PROTECTED] vedran.byethost12.com 3506 Jun 25 14:40 file.gif'] and then when somebody click on file in listbox,then in new Entry widget must write jus

Re: Tkinter listbox question

2006-09-01 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> Wrote: | Hi, | I need help about Tkinter listbox widget.I want,when somebody click on | any item(file) in Listbox,then in new Label widget text must be | selected item from server. | | my program (wrong example): | | import ftputil | import Tkinter | root=Tkin

Tkinter listbox question

2006-08-31 Thread vedran_dekovic
Hi, I need help about Tkinter listbox widget.I want,when somebody click on any item(file) in Listbox,then in new Label widget text must be selected item from server. my program (wrong example): import ftputil import Tkinter root=Tkinter.Tk() ftp=ftputil.FTPHost('some imaginary server&#

Re: custom Tkinter ListBox selectMode

2005-07-03 Thread Eric Brunel
On Fri, 1 Jul 2005 20:19:20 -0400, Ron Provost <[EMAIL PROTECTED]> wrote: > Hello, > > I've written a simple GUI which contains a listbox to hold some information. > I've found that the click-selection schemes provided by Tkinter are > insufficient for my needs. Essentiall I need to impletement a

custom Tkinter ListBox selectMode

2005-07-01 Thread Ron Provost
Hello, I've written a simple GUI which contains a listbox to hold some information. I've found that the click-selection schemes provided by Tkinter are insufficient for my needs. Essentiall I need to impletement a custom selectMode. As a first go, I've attempted to implement a click-on-click-

Re: TkInter Listbox Widget Formatting

2005-06-02 Thread Jeff Epler
This isn't an option in the stock Tk listbox or any of the alternatives I know of offhand (bwidget ListBox, TixTList). The TkTable widget, which can also display multiple columns, can select different justifications, either for the whole table, or for single cells. I've never used TkTable with Pyt

TkInter Listbox Widget Formatting

2005-06-02 Thread Kyle . Robertson
I've searched high and low, and I can't seem to find a way to center or right justify the text in a Listbox widget using TkInter.  The justify option is unrecognized.  Any options I'm missing, or a known work-around?   Thanks!   Kyle -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace single item in tkinter ListBox

2004-12-19 Thread Zhang Le
Thanks for the hint. But I did not try such *advance* techniques so far. Both Delete-then-insert and Insert-then-delete work for me. Interestingly, I found Delete-then-insert can cause some flicking when replacing items near bottom, while Insert-then-delete always works fine. Zhang Le -- http://

Re: Replace single item in tkinter ListBox

2004-12-18 Thread jepler
To the best of my knowledge, the only way to do this is as you describe: delete the old item, then insert the new item. The Tk manpage for "listbox" doesn't describe any commands to only update an item in the list. Actually, you may have another choice, if your Tk is new enough---Tk supports (in

Replace single item in tkinter ListBox

2004-12-18 Thread Zhang Le
Hello, Is there a quick way to replace the content of a single item in tkinter's listbox? Currently my solution is to first delete the item, then insert a new item at the same position. I think there may be better way. Zhang Le -- http://mail.python.org/mailman/listinfo/python-list