Guilherme Polo | 1 Jan 2009 04:34
Picon
Gravatar

Re: TkTable changing the entry widgets

On Wed, Dec 31, 2008 at 7:10 PM, Troy Taillefer <ironwaist29 <at> yahoo.com> wrote:
> Hi all,
>
> I was wondering if anyone knew who to change the entry widgets in TkTable to
> replace them with a custom entry widget like AutoCompletionEntry
> http://tkinter.unpythonic.net/wiki/AutocompleteEntry or ValidatingEntry
> http://tkinter.unpythonic.net/wiki/ValidateEntry.

I would suggest embedding these widgets, and others, instead of trying
to replace the default behaviour of a cell entry in tktable.
Embedding is easy enough given your tktable python wrapper has the
window commands wrapped:

import Tkinter
import tktable

table = tktable.Table()
table.window_configure("2,3", window=Tkinter.Entry())
table.pack()

table.mainloop()

I'm using Tkinter.Entry here, but you could just as well use this
AutoCompleteEntry widget. This "2,3" is the cell index -- third row,
fourth column.
The wrapper I used there can be found at XXX (forgot the link, it is
on http://tkinter.unpythonic.net/wiki but the wiki is inaccessible
now) and also in tktable's cvs since about 1-2 month(s) ago (except
that the one in cvs doesn't yet have the latest updates).

(Continue reading)

Troy Taillefer | 1 Jan 2009 17:45
Picon
Favicon

http://tkinter.unpythonic.net/ is down / unrechable

Hi all,
 
Just wanted to know did someone take http://tkinter.unpythonic.net/ down for maintainance ? I hope it will be back soon learning a lot about tkinter from it.
 
Troy
 

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Guilherme Polo | 1 Jan 2009 20:15
Picon
Gravatar

http://tkinter.unpythonic.net/ is down / unrechable

On Thu, Jan 1, 2009 at 2:45 PM, Troy Taillefer <ironwaist29 <at> yahoo.com> wrote:
> Hi all,
>
> Just wanted to know did someone take http://tkinter.unpythonic.net/ down for
> maintainance ? I hope it will be back soon learning a lot about tkinter from
> it.
>

I just tried accessing it and it seems to be working now.

--

-- 
-- Guilherme H. Polo Goncalves
Guilherme Polo | 1 Jan 2009 23:02
Picon
Gravatar

Re: TkTable changing the entry widgets

On Thu, Jan 1, 2009 at 1:34 AM, Guilherme Polo <ggpolo <at> gmail.com> wrote:
> On Wed, Dec 31, 2008 at 7:10 PM, Troy Taillefer <ironwaist29 <at> yahoo.com> wrote:
>> Hi all,
>>
>> I was wondering if anyone knew who to change the entry widgets in TkTable to
>> replace them with a custom entry widget like AutoCompletionEntry
>> http://tkinter.unpythonic.net/wiki/AutocompleteEntry or ValidatingEntry
>> http://tkinter.unpythonic.net/wiki/ValidateEntry.
>
> I would suggest embedding these widgets, and others, instead of trying
> to replace the default behaviour of a cell entry in tktable.
> Embedding is easy enough given your tktable python wrapper has the
> window commands wrapped:
>
> import Tkinter
> import tktable
>
> table = tktable.Table()
> table.window_configure("2,3", window=Tkinter.Entry())
> table.pack()
>
> table.mainloop()
>
> I'm using Tkinter.Entry here, but you could just as well use this
> AutoCompleteEntry widget. This "2,3" is the cell index -- third row,
> fourth column.
> The wrapper I used there can be found at XXX (forgot the link, it is
> on http://tkinter.unpythonic.net/wiki but the wiki is inaccessible
> now) and also in tktable's cvs since about 1-2 month(s) ago (except
> that the one in cvs doesn't yet have the latest updates).
>
>> Also if anyone knows how
>> to enhance TkTable to do column sorting or point me to some good links it
>> would be greatly apreciated thanks.
>>
>
> It is a matter of reorganizing the ArrayVar associated to the table
> since tktable doesn't have a built-in sort yet. Have you tried doing
> anything like this ?
>

I've added something here now:
http://tkinter.unpythonic.net/wiki/SorTable (I wanted to take
SortableTable but someone else took it before me)

>> Troy
>

--

-- 
-- Guilherme H. Polo Goncalves
Nawal Husnoo | 2 Jan 2009 17:17
Picon

Python2.5.1+Tkinter+Tile0.8.2

Dear Tkinter users/developers,

I'm just starting out in Python Tkinter programming, and I tried to use the Tile module to improve the looks of the Tk program I am writing.

When I run the script written in <code></code> below, it works fine, using the Tile module to make the Tk look ok. However, when I try to use tkMessageBox.showwarning() as in the script, it fails with the error below. I've tried to cat | grep for "background" in the files mentionned in the error, but nothing turns up. I can't find where the "-background" switch is getting stuck in. I know the "background" switch doesn't work with Tile, but I can't find it to remove it. Any ideas please?

Thanks,

Nawal.

<error>

/usr/lib/python2.4/site-packages/apt/__init__.py:2: RuntimeWarning: Python C API version mismatch for module apt_pkg: This Python has API version 1013, module apt_pkg has version 1012.
  import apt_pkg
Traceback (most recent call last):
  File "./tktest.py", line 81, in <module>
  tkMessageBox.showwarning("Open file","Cannot open this file\n")
  File "/usr/lib/python2.5/lib-tk/tkMessageBox.py", line 85, in showwarning
  return _show(title, message, WARNING, OK, **options)
  File "/usr/lib/python2.5/lib-tk/tkMessageBox.py", line 72, in _show
  res = Message(**options).show()
  File "/usr/lib/python2.5/lib-tk/tkCommonDialog.py", line 48, in show
  s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: unknown option "-background"

</error>

Here's the script:

<code>

#! /usr/bin/env python

from Tkinter import *
import tkMessageBox

def callback():
  print "called the callback!"

root = Tk()
root.tk.call('package', 'require', 'tile')
root.tk.call('namespace', 'import', '-force', 'ttk::*')
root.tk.call('ttk::setTheme', 'clam')

def callback():
  print "called the callback!"

# create a toolbar
toolbar = Frame(root)

b = Button(toolbar, text="new", width=6, command=callback)
b.pack(side=LEFT, padx=2, pady=2)

b = Button(toolbar, text="open", width=6, command=callback)
b.pack(side=LEFT, padx=2, pady=2)

toolbar.pack(side=TOP, fill=X)

status = Label(root, text="", relief=SUNKEN, anchor=W)
status.pack(side=BOTTOM, fill=X)

# create a menu
menu = Menu(root)
root.config(menu=menu)

filemenu = Menu(menu)
menu.add_cascade(label="File", menu=filemenu)
filemenu.add_command(label="New", command=callback)
filemenu.add_command(label="Open...", command=callback)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=callback)

#tkMessageBox.showwarning("Open file","Cannot open this file\n")

mainloop()
</code>

--

The best way to predict the future is to invent it. - Alan Kay
http://www.galileon.co.uk/
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
pellegrini | 5 Jan 2009 12:09
Picon

Problem with grid layout

Hello everybody,

I have a problem with the grid management.

Here is the following simple script:

######################################################################
from Tkinter import *
root = Tk()
f = Frame(root)
f.grid(row = 0, column = 0, sticky = W)

f1 = Frame(f, relief = GROOVE, bd = 2)
f1.grid(row = 0, column = 0, sticky = W)
str1 = StringVar(root,'%-20s' % 'Label')
Label(f1, textvariable = str1, anchor = W).grid(row = 0, column = 0, 
sticky = W)
Button(f1, text = 'Button1').grid(row = 0, column = 1)

f2 = Frame(f, relief = GROOVE, bd = 2)
f2.grid(row = 1, column = 0, sticky = W)
str2 = StringVar(root,'%-20s' % 'BiggerLabel')
Label(f2, textvariable = str2, anchor = W).grid(row = 0, column = 0, 
sticky = W)
Button(f2, text = 'Button2').grid(row = 0, column = 1)

root.mainloop()
######################################################################

I would expect that script to produce two frames with exactly the same 
size but it is not the case.
However the two labels have the same size by construction (i.e. 20).

Would you have any idea ?

thank you very much

Eric Pellegrini
pellegrini | 5 Jan 2009 12:12
Picon

Problem with grid layout

Hello everybody,

I have a problem with the grid management.

Here is the following simple script:

######################################################################
from Tkinter import *
root = Tk()
f = Frame(root)
f.grid(row = 0, column = 0, sticky = W)

f1 = Frame(f, relief = GROOVE, bd = 2)
f1.grid(row = 0, column = 0, sticky = W)
str1 = StringVar(root,'%-20s' % 'Label')
Label(f1, textvariable = str1, anchor = W).grid(row = 0, column = 0, 
sticky = W)
Button(f1, text = 'Button1').grid(row = 0, column = 1)

f2 = Frame(f, relief = GROOVE, bd = 2)
f2.grid(row = 1, column = 0, sticky = W)
str2 = StringVar(root,'%-20s' % 'BiggerLabel')
Label(f2, textvariable = str2, anchor = W).grid(row = 0, column = 0, 
sticky = W)
Button(f2, text = 'Button2').grid(row = 0, column = 1)

root.mainloop()
######################################################################

I would expect that script to produce two frames with exactly the same 
size but it is not the case.
However the two labels have the same size by construction (i.e. 20).

Would you have any idea ?

thank you very much

Eric Pellegrini
Guilherme Polo | 5 Jan 2009 13:07
Picon
Gravatar

Re: Problem with grid layout

On Mon, Jan 5, 2009 at 9:09 AM, pellegrini <pellegrini <at> ill.fr> wrote:
> Hello everybody,
>
> I have a problem with the grid management.
>
> Here is the following simple script:
>
> ######################################################################
> from Tkinter import *
> root = Tk()
> f = Frame(root)
> f.grid(row = 0, column = 0, sticky = W)
>
> f1 = Frame(f, relief = GROOVE, bd = 2)
> f1.grid(row = 0, column = 0, sticky = W)
> str1 = StringVar(root,'%-20s' % 'Label')
> Label(f1, textvariable = str1, anchor = W).grid(row = 0, column = 0, sticky
> = W)
> Button(f1, text = 'Button1').grid(row = 0, column = 1)
>
> f2 = Frame(f, relief = GROOVE, bd = 2)
> f2.grid(row = 1, column = 0, sticky = W)
> str2 = StringVar(root,'%-20s' % 'BiggerLabel')
> Label(f2, textvariable = str2, anchor = W).grid(row = 0, column = 0, sticky
> = W)
> Button(f2, text = 'Button2').grid(row = 0, column = 1)
>
> root.mainloop()
> ######################################################################
>
> I would expect that script to produce two frames with exactly the same size
> but it is not the case.
> However the two labels have the same size by construction (i.e. 20).
>
> Would you have any idea ?
>

strings of same length won't give you labels of same size, since that
matters nothing when you are not using a monospace font.
If you just want frames with same size, change theirs stickys to "ew".

> thank you very much
>
> Eric Pellegrini
>
>

--

-- 
-- Guilherme H. Polo Goncalves
waffles123 | 9 Jan 2009 02:28
Picon
Favicon

Scrolling canvas (Including all widgets on it)


I'm trying to make a canvas scrollable, but the problem is I can only get
things that I've drawn, or what not on the canvas to move. I want to be able
to move every widget (In this case, 70 odd entry boxes, and a few labels)

The full code is http://www.nomorepasting.com/getpaste.php?pasteid=23309
--

-- 
View this message in context: http://www.nabble.com/Scrolling-canvas-%28Including-all-widgets-on-it%29-tp21364650p21364650.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
Michael O'Donnell | 9 Jan 2009 09:08
Picon
Picon
Favicon

Re: Scrolling canvas (Including all widgets on it)

Hi Waffles,

  Rather than using place() to put widgets within the canvas,
you need to actually draw them. Use the canvas method: create_window()

E.g., taking two of your lines:

    self.topic_label = Label(self.label, text='Topic:', font=15, bg='white')
    self.topic_label.place(x=16, y=8)

Should be:

    self.topic_label = Label(self.label, text='Topic:', font=15, bg='white')
    self.label.create_window(16, 8, window=self.topic_label, anchor=NW)

Mick

On Fri, Jan 9, 2009 at 2:28 AM, waffles123 <drunkenmousehide <at> hotmail.com> wrote:
>
> I'm trying to make a canvas scrollable, but the problem is I can only get
> things that I've drawn, or what not on the canvas to move. I want to be able
> to move every widget (In this case, 70 odd entry boxes, and a few labels)
>
> The full code is http://www.nomorepasting.com/getpaste.php?pasteid=23309
> --
> View this message in context: http://www.nabble.com/Scrolling-canvas-%28Including-all-widgets-on-it%29-tp21364650p21364650.html
> Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss <at> python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>

Gmane