Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8419161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:32:13+00:00 2026-06-10T02:32:13+00:00

Hey guys im a beginner in python and im doing a numberpad that shows

  • 0

Hey guys im a beginner in python and im doing a numberpad that shows number in a textbox.

The GUI works and everything, but when I wanna press a button I get this message:

Traceback (most recent call last):

File "C:\Users\E-net\Documents\PythonT9\python.py", line 5, in press
    num = entry.Box.get_text()
AttributeError: 'gtk.Entry' object has no attribute 'Box'

And I cant figur out why 🙁

The code

import gtk

def press(widget):

    num = entry.box.get_text()
    pnum = widget.get_label()
    entry.set_text(num+pnum)

def send_press(widget):
    print "dialing:" + entry.get_text()

win = gtk.Window()
win.connect('destroy', lambda w: gtk.main_quit())

box = gtk.VBox()
win.add(box)

entry = gtk.Entry()
box.pack_start(entry,False)

table = gtk.Table(2,2, gtk.TRUE)

a = [1,2,3,4,5,6,7,8,9,"#",0,"*"]
x = 0
y = 0

for i in a: 
    button = gtk.Button(str(i))
    button.connect("clicked",press)
    table.attach(button,x,x+1,y,y+1 )

    x+=1
    if x > 2:
        x = 0
        y+=1


box.pack_start(table)

send = gtk.Button("SEND")
send.connect("clicked",send_press)
box.pack_start(send)
win.show_all()

gtk.main()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:32:14+00:00Added an answer on June 10, 2026 at 2:32 am

    Seems pretty straightforward – just change:

    num = entry.box.get_text()

    to

    num = entry.get_text()

    BTW, you could have solved this “mystery” in cca 30seconds if you just looked at the pygtk documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys, beginner here. I have written a program that outputs files to .txt's
Hey guys, I have a GridView which is binded to SqlDataSource, everything works fine,
hey guys having this really simple problem but cant seem to figure out have
Hey guys I wanted to create a JScrollPane but it won't work... and I
Hey guys i'm making a website but for some reason my div tags are
Hey guys, sorry I'm kind of new to programming, but I had a small
Hey guys I just noticed that my join statement here SELECT * FROM reports
Hey guys i am currently working on an android app that will allow me
hey guys i wanna ask a question about sending data to database to server
Hey guys I'm using python and I was just wondering how we can make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.