Jump to content
Fórum Script Brasil
  • 0

Porque Os Tipos Primitivos Do Tkinter (intvar E Stringvar), não Retor


Guest Tipos primivitos do Tkinter
 Share

Question

Guest Tipos primivitos do Tkinter

Eu de novo,

não estou conseguindo recuperar nem o IntVar de um Radionbutton e nem a StringVar de um entry no programa simplificado abaixo:

from Tkinter import *

from customer import *

class customerInterface:

def __init__(self, master):

self.nameEntry = Entry(master)

self.c1 = StringVar()

self.nameEntry["textvariable"]=self.c1

self.nameEntry.pack()

self.nameEntry.grid(row=0,column=1)

self.buttonSave = Button(master,text=Save",command=self.save).grid(row=9,columnspan=2, sticky=W+E+N+S)

def save(self):

self.c1.get()

class customerListInterface:

def __init__(self, master, lista):

self.idR = IntVar()

for i in range(0,lenght):

self.idRadio = Radiobutton(master)

self.idRadio["variable]=self.idR

self.idRadio["value"]=i

self.idRadio.pack()

self.idRadio.grid(row=(i+1), column=7, sticky=W)

self.deleteButton["command"]=self.delete

def delete(self):

print self.idR.get()

Ambos retornam os respectivos valores iniciais 0 e " "

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...