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
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
[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
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))
> >> # ...
>
> >>
[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
>
> 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
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
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
[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
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
[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:
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
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
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
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
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
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
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
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?
19 matches
Mail list logo