Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread skanemupp
it works now. here is all the code: #! /usr/bin/env python from Tkinter import * import tkMessageBox class GUIFramework(Frame): """This is the GUI""" def __init__(self, master=None): """Initialize yourself""" """Initialise the base class""" Frame.__init__(self,ma

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread 7stud
On Apr 5, 12:02 am, [EMAIL PROTECTED] wrote: > am i not doing that then? did u look at the code? where do i add the > bind if this: > btnDisplay = Button(self, text="1", command=self.Display) >         btnDisplay.grid(row=3, column=0, padx=5, pady=5) > > is not enough? > > def Display(self, event_o

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > i dont know, i used a piece of code i found which had a createwidgets- > method. isnt init a function, not a method btw(or it is the same > thing?) a method is a function defined inside a class statement, and which is designed to be called via an instance of that class

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread skanemupp
On 5 Apr, 17:09, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> def __init__(self): > >> # ... > >> button = Button(self, > >> text='1', > >> command=lambda n=1: self.display(n)) > >> # ... > > >>

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >> def __init__(self): >> # ... >> button = Button(self, >> text='1', >> command=lambda n=1: self.display(n)) >> # ... >> >> def display(self, number): >> print number > > should this

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread skanemupp
> > def __init__(self): > # ... > button = Button(self, > text='1', > command=lambda n=1: self.display(n)) > # ... > > def display(self, number): > print number > should this really be inside the __init__ fun

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Fredrik Lundh
Francesco Bochicchio wrote: > It should be added here that in Python you have several ways get around > this Tkinter limitation and pass an user argument to the callback. Once > upon a time , back in Python 1.x, I used to do something like this: > > class CallIt: > def __init__(self, f, *a

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Francesco Bochicchio
Il Fri, 04 Apr 2008 20:26:13 -0700, 7stud ha scritto: > On Apr 4, 7:06 pm, [EMAIL PROTECTED] wrote: >> 1st question: >> >> when i run this program 1 will be printed into the interpreter when i >> run it BUT without me clicking the actual button. when i then click the >> button "1", nothing happens

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: [stuff, including quoted copies of an original program and its replacement] > > and the self. i erased, should i do it in the def __init__ as well or > only as i did in createwidgets-function? Your posts would be easier to consider if you trimmed out the stuff that's no

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Gabriel Genellina
En Sat, 05 Apr 2008 03:02:02 -0300, <[EMAIL PROTECTED]> escribió: > am i not doing that then? did u look at the code? where do i add the > bind if this: > btnDisplay = Button(self, text="1", command=self.Display) > btnDisplay.grid(row=3, column=0, padx=5, pady=5) > > is not enough? Yes, I

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread 7stud
[EMAIL PROTECTED] wrote: > > one thing i dont rally get, i ahve to add my_button.bind() somewhere? > i changed the stuff u said though and i get this error(the program > executes though and i can press the buttons): > > Exception in Tkinter callback > Traceback (most recent call last): > File "C:

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-05 Thread Marc 'BlackJack' Rintsch
On Fri, 04 Apr 2008 20:26:13 -0700, 7stud wrote: > However, there is another way to cause a function to execute when an > event, like a button click, occurs on a widget: you use the widget's > bind() function: > > my_button.bind('', someFunc) That's a bad idea because now the `Button` doesn't ac

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread skanemupp
am i not doing that then? did u look at the code? where do i add the bind if this: btnDisplay = Button(self, text="1", command=self.Display) btnDisplay.grid(row=3, column=0, padx=5, pady=5) is not enough? def Display(self, event_obj): button = event_obj.widget text = but

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread Gabriel Genellina
En Sat, 05 Apr 2008 02:02:45 -0300, <[EMAIL PROTECTED]> escribió: > one thing i dont rally get, i ahve to add my_button.bind() somewhere? > i changed the stuff u said though and i get this error(the program > executes though and i can press the buttons): Either use command, or bind. command requi

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread skanemupp
On 5 Apr, 07:02, [EMAIL PROTECTED] wrote: > On 5 Apr, 05:57, [EMAIL PROTECTED] wrote: > > > > > On 5 Apr, 05:26, 7stud <[EMAIL PROTECTED]> wrote: > > > > On Apr 4, 7:06 pm, [EMAIL PROTECTED] wrote: > > > > > 1st question: > > > > > when i run this program 1 will be printed into the interpreter when

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread skanemupp
On 5 Apr, 05:57, [EMAIL PROTECTED] wrote: > On 5 Apr, 05:26, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Apr 4, 7:06 pm, [EMAIL PROTECTED] wrote: > > > > 1st question: > > > > when i run this program 1 will be printed into the interpreter when i > > > run it BUT without me clicking the actual but

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread skanemupp
On 5 Apr, 05:26, 7stud <[EMAIL PROTECTED]> wrote: > On Apr 4, 7:06 pm, [EMAIL PROTECTED] wrote: > > > > > 1st question: > > > when i run this program 1 will be printed into the interpreter when i > > run it BUT without me clicking the actual button. > > when i then click the button "1", nothing hap

Re: TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread 7stud
On Apr 4, 7:06 pm, [EMAIL PROTECTED] wrote: > 1st question: > > when i run this program 1 will be printed into the interpreter when i > run it BUT without me clicking the actual button. > when i then click the button "1", nothing happens. > > obv i dont want any output when i dont push the button b

TKinter, buttonwidget response problem(1) and all btns the same size(2)!

2008-04-04 Thread skanemupp
1st question: when i run this program 1 will be printed into the interpreter when i run it BUT without me clicking the actual button. when i then click the button "1", nothing happens. obv i dont want any output when i dont push the button but i want it when i do. what am i doing wrong here?