473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Scrolling an Entry widget on python

I try to make scrolling on an Entry in python.
when I run program nothing happen.
Please any one help me??

this is my code:

Expand|Select|Wrap|Line Numbers
  1. self.scrollbar = tk.Scrollbar(self,orient="horizontal")
  2.         self.e3 =tk.Entry(self,xscrollcommand=self.scrollbar.set)
  3.         self.e3.focus()
  4.         self.e3.pack(side="bottom",fill="x")
  5.         #self.e3.grid(row=10, column=7)
  6.         self.scrollbar.pack(fill="x")
  7.         self.scrollbar.config(command=self.e3.xview)
  8.         self.e3.config()
Dec 24 '12 #1
1 6659
dwblas
626 Expert 512MB
It works fine for me on Slackware Linux. Note that to scroll you have to have an entry that is wider than the box.
Expand|Select|Wrap|Line Numbers
  1. class TestEntry():
  2.     def __init__(self):
  3.             root = tk.Tk()
  4.             self.scrollbar = tk.Scrollbar(root,orient="horizontal")
  5.             txt = tk.StringVar()
  6.             self.e3 =tk.Entry(root,
  7.                      xscrollcommand=self.scrollbar.set,
  8.                      textvariable=txt)
  9.             txt.set("ABC"*10)  ## add some text to scroll
  10.             self.e3.focus()
  11.             self.e3.pack(side="bottom",fill="x")
  12.             self.scrollbar.pack(fill="x")
  13.             self.scrollbar.config(command=self.e3.xview)
  14.             self.e3.config()
  15.  
  16.             root.mainloop()
  17.  
  18. TestEntry() 
Dec 24 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Phil Schmidt | last post by:
I'm trying to make a custom entry widget, as in the code that follows. There are two problems I'm trying to fix: 1) I would like the widget to behave as myEntry.Escape() does now, except that it...
5
by: Otto Krüse | last post by:
Hi everyone, I'm building a GUI in which I want, amongst other things, for people to fill in there postal code. The postal codes of my country (Holland) are in this format: 1234 AB So for the...
4
by: Clara | last post by:
Hi, can somebody help me,..I have an assignment due next week but now I'm stuck with this problem.... I tried to get values from entry widget using the widgetcontrolvariable.get(),..but it seems...
2
by: wanwan | last post by:
let's say I already have some content. How do I set the widget so user cannot change it/?
2
by: Dustan | last post by:
How do I limit what the user can enter in an Entry Widget? I know I can set it to display '*' to hide a password, but what I want to do is limit the contents to numeric characters. What is the...
1
by: Arne | last post by:
Hello ! I want to create entry widgets dynamically. var = i=0 for x in var: textbox = "t_", x textbox = entry(frame) textbox.grid(row=4+i, column=0) i = i + 1
0
by: Marek S. | last post by:
Hi, I am new in Python and I have no experience in object-oriented programming. I want to make an easy GUI for my application. What is my problem? I have the data-file like this (file...
2
by: Kevin Walzer | last post by:
I'm trying to construct a simple Tkinter GUI and I'm having trouble with getting the value of an entry widget and passing it onto a callback function. But I'm not grokking variable scope correctly....
3
Elias Alhanatis
by: Elias Alhanatis | last post by:
Hello to everybody!! I am running Python 2.5.1 on Windows Vista and i have a problem with the "Entry" widget of Tkinter. Take a look at this code: from Tkinter import * def fetch(): ...
2
by: lee.walczak | last post by:
Hi, I am using Tkinter & the Kevin Walzer's TableList Wrapper for python implemented GUI: http://tkinter.unpythonic.net/wiki/TableListWrapper The TableList has been extremely useful in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.