Search Results

Search found 6 results on 1 pages for 'rejinacm'.

Page 1/1 | 1 

  • close window in Tkinter message box

    - by rejinacm
    Hello, link text How to handle the "End Now" error in the below code: import Tkinter from Tkconstants import * import tkMessageBox tk = Tkinter.Tk() class MyApp: def __init__(self,parent): self.myparent = parent self.frame = Tkinter.Frame(tk,relief=RIDGE,borderwidth=2) self.frame.pack() self.message = Tkinter.Message(tk,text="Symbol Disolay") label=Tkinter.Label(self.frame,text="Is Symbol Displayed") label.pack() self.button1=Tkinter.Button(self.frame,text="YES") self.button1.pack(side=BOTTOM) self.button1.bind("<Button-1>", self.button1Click) self.button2=Tkinter.Button(self.frame,text="NO") self.button2.pack() self.button2.bind("<Button-1>", self.button2Click) self.myparent.protocol("WM_DELETE_WINDOW", self.handler) def button1Click(self, event): print "pressed yes" def button2Click(self, event): print "pressed no" def handler(self): if tkMessageBox.askokcancel("Quit?", "Are you sure you want to quit?"): self.myparent.quit() myapp = MyApp(tk) tk.mainloop()

    Read the article

  • global variable and Python

    - by rejinacm
    A global variable created in one function cannot be used in another function directly. Instead I need to store the global variable in a local variable of the function which needs its access. Am I correct? Why is it so?

    Read the article

  • How to append strings using sprintf ?

    - by rejinacm
    Hey everybody, Thank you all before I start. I am facing a serious issue with sprintf. suppose my code snippet is : sprintf(Buffer,"Hello World"); sprintf(Buffer,"Good Morning"); sprintf(Buffer,"Good Afternoon"); . . . Some hundred sprints.... If i do like this, its getting overwritten. How can I avoid overwritting using sprintf. If i give a printf at the end i want to see all the lines. How to xchieve this.

    Read the article

  • Tkinter button bind

    - by rejinacm
    Hello, Help urgently.. This is my code: import Tkinter from Tkconstants import * tk = Tkinter.Tk() class MyApp: def __init__(self,parent): self.frame = Tkinter.Frame(tk,relief=RIDGE,borderwidth=2) self.frame.pack() self.message = Tkinter.Message(tk,text="Symbol Disolay") label=Tkinter.Label(self.frame,text="Is Symbol Displayed") label.pack() self.button1=Tkinter.Button(self.frame,text="YES") self.button1.pack(side=BOTTOM) self.button1.bind("<Button-1>", self.button1Click) self.button2=Tkinter.Button(self.frame,text="NO") self.button2.pack() self.button2.bind("<Button-1>", self.button2Click) def button1Click(self, event): "pressed yes" def button2Click(self, event): "pressed no" myapp = MyApp(tk) tk.mainloop() What shall i do in button1Click() and button2Click() so that they return "YES" or "NO" to my program in string format ???

    Read the article

  • Global variables in Python

    - by rejinacm
    A global variable created in one function cannot be used in another function directly. Instead I need to store the global variable in a local variable of the function which needs its access. Am I correct? Why is it so?

    Read the article

1