On Wed, 6 Jan 2021, Terry Reedy wrote:
'underline' has nothing to do with looking up the command in
self.callbacks. It is a keyword parameter for the add_command method, and
is handled like all other values passed by name, and as you did for the
other arguments
file_menu.add_command(
On 1/6/2021 4:17 PM, Terry Reedy wrote:
On 1/6/2021 4:03 PM, Rich Shepard wrote:
On Thu, 7 Jan 2021, Chris Angelico wrote:
Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.
ChrisA,
I'm always open to learning. There's no error generat
On Thu, 7 Jan 2021, Peter Otten wrote:
Spoiler: unless the name 'underline' is defined you get a NameError:
NameError: name 'underline' is not defined
If it is defined and self.callbacks is a dict you get a TypeError:
TypeError: unhashable type: 'slice'
because that's what a colon means in a con
On 06/01/2021 22:03, Grant Edwards wrote:
I'm completely baffled by that. Can somebody explain how this
expression is evaluated?
self.callbacks['file->new', underline: 0]
It appears that the dict callbacks is being accessed with the key of
a tuple comprising a string and a slice.
Huh?
Y
On 06/01/2021 22:03, Rich Shepard wrote:
On Thu, 7 Jan 2021, Chris Angelico wrote:
Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.
ChrisA,
I'm always open to learning. There's no error generated ... yet the
application doesn' open so
On Thu, Jan 7, 2021 at 9:22 AM Grant Edwards wrote:
>
> On 2021-01-06, Rich Shepard wrote:
> > On Wed, 6 Jan 2021, 2qdxy4rzwzuui...@potatochowder.com wrote:
> >
> >> For the sake of future generations who may run into this issue, can you
> >> post the complete, correct call to file_menu.add_comma
On 1/6/2021 4:03 PM, Rich Shepard wrote:
On Thu, 7 Jan 2021, Chris Angelico wrote:
Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.
ChrisA,
I'm always open to learning. There's no error generated ... yet the
application doesn' open so
On 2021-01-06, Rich Shepard wrote:
> On Wed, 6 Jan 2021, 2qdxy4rzwzuui...@potatochowder.com wrote:
>
>> For the sake of future generations who may run into this issue, can you
>> post the complete, correct call to file_menu.add_command?
>
> This is the working version of the stanza I initially pos
On Thu, 7 Jan 2021, Chris Angelico wrote:
Cool. Terry had something on the subject in the other thread; I think
that's a good place to start. (I don't know much about Tkinter, this line
of code just looked odd in general Python syntax.)
ChrisA,
It's been a long time since I wrote any Python c
On Thu, Jan 7, 2021 at 8:04 AM Rich Shepard wrote:
>
> On Thu, 7 Jan 2021, Chris Angelico wrote:
>
> > Are you sure that this works? It's syntactically valid, but I don't
> > think it means what you think it does.
>
> ChrisA,
>
> I'm always open to learning. There's no error generated ... yet the
On Thu, 7 Jan 2021, Chris Angelico wrote:
Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.
ChrisA,
I'm always open to learning. There's no error generated ... yet the
application doesn' open so it's time to run it through pdb.
Regards
On Thu, Jan 7, 2021 at 7:43 AM Rich Shepard wrote:
> This is the working version of the stanza I initially posted:
>
> file_menu.add_command(
> label = 'New',
> command = self.callbacks['file->new', underline: 0],
> accelerator = 'Ctrl+N'
> )
On Wed, 6 Jan 2021, 2qdxy4rzwzuui...@potatochowder.com wrote:
For the sake of future generations who may run into this issue, can you
post the complete, correct call to file_menu.add_command?
This is the working version of the stanza I initially posted:
file_menu.add_command(
On 1/6/2021 1:32 PM, Rich Shepard wrote:
My application's menu has lines like this:
file_menu.add_command(
label = 'New',
command = self.callbacks['file->new', underline 0],
accelerator = 'Ctrl+N'
)
'underline' has nothing to do with look
On 2021-01-06 at 11:18:15 -0800,
Rich Shepard wrote:
> On Wed, 6 Jan 2021, 2qdxy4rzwzuui...@potatochowder.com wrote:
>
> > I'm not a TKinter expert (nor even a current user), but that line that
> > begins with whitespace and "command =" looks suspicious. As far as I can
> > see, Python is correc
On Wed, 6 Jan 2021, 2qdxy4rzwzuui...@potatochowder.com wrote:
I'm not a TKinter expert (nor even a current user), but that line that
begins with whitespace and "command =" looks suspicious. As far as I can
see, Python is correct to call it syntactically erroneous.
Yes, the line above it needed
On 2021-01-06 at 10:32:58 -0800,
Rich Shepard wrote:
> My application's menu has lines like this:
> file_menu.add_command(
> label = 'New',
> command = self.callbacks['file->new', underline 0],
> accelerator = 'Ctrl+N'
> )
>
> Python reports a
My application's menu has lines like this:
file_menu.add_command(
label = 'New',
command = self.callbacks['file->new', underline 0],
accelerator = 'Ctrl+N'
)
Python reports a syntax error when specifying the string index to underline;
it rejects
On 8/5/2014 7:33 PM, Nicholas Cannon wrote:
I am confused. When I did menu bar.add_cascade why don't I do
filemenu.add_cascade. Is it because I am adding a cascade to the main menubar?
Let us start with a widget, that can 'contain' other widgets (and
possibly other things). We create a child
I am confused. When I did menu bar.add_cascade why don't I do
filemenu.add_cascade. Is it because I am adding a cascade to the main menubar?
--
https://mail.python.org/mailman/listinfo/python-list
On 8/5/2014 6:28 PM, Nicholas Cannon wrote:
Ok so I am on 2.7.8.
What x.y.z version of Python. How did you run it, exactly?
Adding filemenu as a submenu of filemenu leads to infinite loop regress.
On 3.4.1 with tcl/tk 8.6, this does not crash, but it might on an
earlier version of Python an
Ok so I am on 2.7.8.
> What x.y.z version of Python. How did you run it, exactly?
> Adding filemenu as a submenu of filemenu leads to infinite loop regress.
>
> On 3.4.1 with tcl/tk 8.6, this does not crash, but it might on an
>
> earlier version of Python and tcl/tk.
> Since menubar is left e
On 8/5/2014 8:15 AM, Nicholas Cannon wrote:
Ok so the first part of the program(until the start of the menu) worked fine.
It ran and did what I wanted it to do.
What x.y.z version of Python. How did you run it, exactly?
I wanted to then implement a new menu(for practise) and then it crashes
Ok so the first part of the program(until the start of the menu) worked fine.
It ran and did what I wanted it to do. I wanted to then implement a new
menu(for practise) and then it crashes. Don't know why but it just crashes.
(also tips on the code will be appreciated and I gave just started Tki
On Oct 4, 11:05 am, galyle wrote:
> On Oct 4, 9:45 am, woooee wrote:
>
>
>
>
>
>
>
>
>
> > Sorry, I did not understand the question correctly, and so have added
> > another focus_set for the entry after the menu's creation. You can
> > still enter after the menu comes up, even though you can't s
On Oct 4, 9:45 am, woooee wrote:
> Sorry, I did not understand the question correctly, and so have added
> another focus_set for the entry after the menu's creation. You can
> still enter after the menu comes up, even though you can't see where
> you are entering.
>
> import Tkinter
>
> class dem
Sorry, I did not understand the question correctly, and so have added
another focus_set for the entry after the menu's creation. You can
still enter after the menu comes up, even though you can't see where
you are entering.
import Tkinter
class demo:
def __init__(self, parent):
self.
Adding focus_set seems to work for me. What do want to do
differently?
import Tkinter
class demo:
def __init__(self, parent):
self._entry = Tkinter.Entry(width = 60)
self._suggestions = Tkinter.Menu(parent, tearoff = 0,
takefocus = 0)
self._entry.pack(padx = 20, pady
On Oct 3, 2:40 pm, rantingrick wrote:
> On Oct 3, 2:55 pm, galyle wrote:
>
> > Hello, I'm trying to build a menu which provides suggestions to a user
> > based on input to an entry. I have done something like this before
> > using Tcl/Tk, so I expected that it would work without much difficulty
On Oct 3, 2:55 pm, galyle wrote:
> Hello, I'm trying to build a menu which provides suggestions to a user
> based on input to an entry. I have done something like this before
> using Tcl/Tk, so I expected that it would work without much difficulty
> with Tkinter. I was wrong.
Why not just use
Hello, I'm trying to build a menu which provides suggestions to a user
based on input to an entry. I have done something like this before
using Tcl/Tk, so I expected that it would work without much difficulty
with Tkinter. I was wrong.
The problem I have is that, as soon as the menu is posted, i
Le 09/06/2010 20:37, rantingrick a écrit :
On Jun 9, 12:20 pm, Dodo wrote:
Le 09/06/2010 18:54, rantingrick a crit :
On Jun 9, 11:26 am, Dodowrote:
Hello,
I trying to make this piece of code work (this is python3)
from tkinter import *
from tkinter.ttk import *
class Window:
On Jun 9, 12:20 pm, Dodo wrote:
> Le 09/06/2010 18:54, rantingrick a crit :
>
>
>
>
>
> > On Jun 9, 11:26 am, Dodo wrote:
> >> Hello,
>
> >> I trying to make this piece of code work (this is python3)
>
> >> from tkinter import *
> >> from tkinter.ttk import *
>
> >> class Window:
> >> def __in
Le 09/06/2010 18:54, rantingrick a écrit :
On Jun 9, 11:26 am, Dodo wrote:
Hello,
I trying to make this piece of code work (this is python3)
from tkinter import *
from tkinter.ttk import *
class Window:
def __init__(self):
self.root = Tk()
self.menu = Menu(self.root)
self.roo
On Jun 9, 11:26 am, Dodo wrote:
Also you are now NOT using 8 space indention unlike your last post --
which i applaud you for. However you've gone to the opposite extreme
with 2 space indention and interlaced it with one space indention, oh
dear!
Please use four space indention as this is the p
On 6/9/2010 12:26 PM, Dodo wrote:
Hello,
I trying to make this piece of code work (this is python3)
from tkinter import *
from tkinter.ttk import *
class Window:
def __init__(self):
self.root = Tk()
self.menu = Menu(self.root)
self.root['menu'] = self.menu
self.submenu = Menu(self.menu)
self
On Jun 9, 11:26 am, Dodo wrote:
> Hello,
>
> I trying to make this piece of code work (this is python3)
>
> from tkinter import *
> from tkinter.ttk import *
>
> class Window:
> def __init__(self):
> self.root = Tk()
>
> self.menu = Menu(self.root)
> self.root['menu'] = self.menu
>
>
Hello,
I trying to make this piece of code work (this is python3)
from tkinter import *
from tkinter.ttk import *
class Window:
def __init__(self):
self.root = Tk()
self.menu = Menu(self.root)
self.root['menu'] = self.menu
self.submenu = Menu(self.menu)
self.ck = 0
self.submenu.a
Hello! I am trying to figure out if it is possible to place a Tkinter
menu within a frame. This would be instead of having the menu-bar at
the top of the window.
Thanks,
Sam
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 22 Feb 2008 13:30:06 +0100, <[EMAIL PROTECTED]> wrote:
[snip]
> Sub problems: how to change state of menu item? how to detect changes
> in Text widget?
If you have a reasonably recent tcl/tk version (>= 8.4), you should have a
edit_modified() method on your Text telling you if it has bee
Rob Wolfe wrote:
> But I think that you should read this:
> http://effbot.org/zone/vroom.htm
Rob, may the gods shower you with gold coins!
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
> Tkinter definitely deserves more respect! I'm making rapid progress
> and it looks good.
>
> But am stuck on this: I want the File/Save state to change from
> disabled to enabled, depending on whether or not there is something to
> save (Text modified). Google returns r
Tkinter definitely deserves more respect! I'm making rapid progress
and it looks good.
But am stuck on this: I want the File/Save state to change from
disabled to enabled, depending on whether or not there is something to
save (Text modified). Google returns results in every language except
Python
Dave Opstad wrote:
> In article <[EMAIL PROTECTED]>,
> Kevin Walzer <[EMAIL PROTECTED]> wrote:
>
>> I'm having difficulty structuring a Tkinter menu entry. Here is the
>> command in question:
>>
>> self.finkmenu.add_command(label='Upda
[EMAIL PROTECTED] wrote:
> On Mar 30, 2:32 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote:
>> I'm having difficulty structuring a Tkinter menu entry. Here is the
>> command in question:
>>
>> self.finkmenu.add_command(label='Update List of Packages',
&g
On Mar 30, 2:32 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote:
> I'm having difficulty structuring a Tkinter menu entry. Here is the
> command in question:
>
> self.finkmenu.add_command(label='Update List of Packages',
> command=self.authorizeCommand(self.scanPa
On Mar 30, 2:32 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote:
> I'm having difficulty structuring a Tkinter menu entry. Here is the
> command in question:
>
> self.finkmenu.add_command(label='Update List of Packages',
> command=self.authorizeCommand(self.scanPa
In article <[EMAIL PROTECTED]>,
Kevin Walzer <[EMAIL PROTECTED]> wrote:
> I'm having difficulty structuring a Tkinter menu entry. Here is the
> command in question:
>
> self.finkmenu.add_command(label='Update List of Packages',
> command=self.author
I'm having difficulty structuring a Tkinter menu entry. Here is the
command in question:
self.finkmenu.add_command(label='Update List of Packages',
command=self.authorizeCommand(self.scanPackages))
When I start my program, it crashes because it's trying
> Please tell me is here anything that I should change.
The way you have written it, master _must_ be a Toplevel object. So,
maybe parent is the correct name, but it doesn't really matter.
As a side note, there is no reason for this class to inherit Frame.
Aside from packing and sizing the frame,
what is the best way to write tkinter menus? As toplevels or as frame
with Menubutton?
im doing like this
class MyWidget(Frame):
def __init__(self, master=None):""" should this master be
parent? Because my first tought was that this is toplevel master than i
found that its not"""
hi i have create widget with menu bar and menus on it.
when i resize my widget to less than menubar is than from
right to left menus on menubar goes to second row.
who to disable that?
all I want is that when i resize my widget to less size, that menus on
menubar stays on default position .
thank
e nice if say, I could make the menu only go to the borders of
> > the application itself (in this case, not that long).
>
> To limit the menu in the application window, will be difficult. But here
> are two ways of automatically limiting the
application itself (in this case, not that long).
To limit the menu in the application window, will be difficult. But here
are two ways of automatically limiting the number of entries that can
appear in a menu by specializing the Tkinter Menu class:
-
I don't know if this is because of Tkinter (ie Tk) itself or the
Windows default way of handling things, but when I create a very long
menu (my test is shown below), the way it displays is rather sucky; the
menu stretches from the top of the moniter's window to the bottom (no
matter the size of the
Edward K. Ream wrote:
> Hi,
>
>
>
> I've spent a pleasant hour or so trying to bring up a top-level Tk menu at
> the same spot as it would appear if I had actually clicked the menu. That
> is, I want to bring up a menu from the keyboard.
>
>
>
> The problem is computing the x and y args to
> I've spent a pleasant hour or so trying to bring up a top-level Tk menu at
> the same spot as it would appear if I had actually clicked the menu. That
> is, I want to bring up a menu from the keyboard.
I'm going to investigate how to locate the 'button' that forms the anchor
for the menu. T
Hi,
I've spent a pleasant hour or so trying to bring up a top-level Tk menu at
the same spot as it would appear if I had actually clicked the menu. That
is, I want to bring up a menu from the keyboard.
The problem is computing the x and y args to menu.post. menu.winfo_x and
menu.winfo_ro
>
> the easiest way to do this is to create a new function object for each
> file, and use default argument binding to pass in the right filename:
>
> for file in self.allfiles:
> def callback(fname=file):
> self.showFile(fname, parent)
> self.showfilemenu_bar.add
<[EMAIL PROTECTED]> wrote:
> I'm writing a small GUI program in Python/Tkinter (my first Python
> program). I want to make a menu which lists the names of a number of
> text files that my program uses/generates. When I select one of the
> files from the menu, I would like a new window to open up
Hi,
I'm writing a small GUI program in Python/Tkinter (my first Python
program). I want to make a menu which lists the names of a number of
text files that my program uses/generates. When I select one of the
files from the menu, I would like a new window to open up a scroll box
containing the fi
Xuening wrote:
> I have a problem about menu by using Tkinter. I want to make a dynamic
> menu. That is when I create a new view/window, one menuitem will be
> added to the menu. and when I kill a window, the correponding menuitem
> will be deleted. I write a simple code and I can add menuitem now.
Xuening wrote:
> I have a problem about menu by using Tkinter. I want to make a dynamic
> menu. That is when I create a new view/window, one menuitem will be
> added to the menu. and when I kill a window, the correponding menuitem
> will be deleted. I write a simple code and I can add menuitem now.
I have a problem about menu by using Tkinter. I want to make a dynamic
menu. That is when I create a new view/window, one menuitem will be
added to the menu. and when I kill a window, the correponding menuitem
will be deleted. I write a simple code and I can add menuitem now. But
I don't know how t
Yeah. It works on a Sun and Linux, but not Windows. That stinks. We got a
bunch of 1400x1050 display laptops in and now I have to run around changing
a bunch of programs that looked fine on 1024x768 displays.
Thanks!
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Tk tries to u
Tk tries to use the "native" menu control on Windows (and, I think, MacOS).
One result seems to be that for the application's menu bar you can't change the
font.
Of course, Windows provides a way for users to select a uniform font for
menu bars in all applications, in the Display control panel.
J
Option adding "Menu*font" changes the font size of the _commands,
_radiobuttons, etc., but not the "File", "Edit", etc. labels on the menubar
itself. What is the name for those labels? If I go
Top.add_cascade(Label = "File", menu = Fi, font = "Courier 20")
they change, but I can't figure o
Thanks for the reply. I now have radio buttons (with a nice tick!) on my
menu that can be greyed out when disabled. I can also change the background
colour of the individual buttons as you suggest.
What I cannot do is change the background colour of the menu bar itself. The
following code is ac
On Wed, 09 Feb 2005 11:35:40 GMT, John Pote <[EMAIL PROTECTED]>
wrote:
I have a menu bar in a top level window as follows
[snip code]
Q1 Cannot find a way of changing the menu bars background colour. When
colour options are accepted they seem to be ignored. Is this a native
look
and feel chara
On Wed, 09 Feb 2005 11:35:40 GMT, John Pote <[EMAIL PROTECTED]>
wrote:
I have a menu bar in a top level window as follows
[snip code]
Q1 Cannot find a way of changing the menu bars background colour. When
colour options are accepted they seem to be ignored. Is this a native
look
and feel chara
I have a menu bar in a top level window as follows
menuBar = Menu(rootWin)
menuBar.add_command( label='Quit', command=rootWin.quit)
configMenu = Menu(menuBar, tearoff=0)
configMenu.add_command(label='Left Device Raw', command=setLeftRaw)
configMenu.add_command(label='Right Device Raw', comma
71 matches
Mail list logo