Tkinter: modify xview of entry widget
Hi, I'm Paolo from Italy and I'm a python user. I wish to propose a useful and smart method modify in Tkinter Library: Previously to scroll this widget we had to write an external function (recalling xview_moveto and xview_scroll). With my method this operation is cleared and the same as all other widgets (just have to call xview). ---------------------------------------------------------- Modify Proposal: ---------------------------------------------------------- Change the method xview of entry so it works as all widget scrollable, and it's compatible with 'old' xview. So to scroll entry widget: entry_widget['xscrollcommand']=scroll_widget.set scroll_widget['command']=entry_widget.xview The change in module Tkinter is: def xview(self,*args): """Query and change horizontal position of the view.""" #modify if not args: return self._getdoubles(self.tk.call(self._w, 'xview')) #old code index=args[0] self.tk.call(self._w, 'xview', index) ---------------------------------------------------------- I wish that this implementation could be integrated in Tkinter, and I remain at disposal for any question or further information. Waiting for your response, Best regards Paolo Fraguglia
paolo.fragu@libero.it wrote:
Hi, I'm Paolo from Italy and I'm a python user. I wish to propose a useful and smart method modify in Tkinter Library:
Hi Paolo, Can you create an issue on the bug tracker - with the patch attached. Your suggestion stands a much better chance if this patch includes tests and documentation. All the best, Michael Foord
Previously to scroll this widget we had to write an external function (recalling xview_moveto and xview_scroll).
With my method this operation is cleared and the same as all other widgets (just have to call xview).
---------------------------------------------------------- Modify Proposal: ---------------------------------------------------------- Change the method xview of entry so it works as all widget scrollable, and it's compatible with 'old' xview.
So to scroll entry widget:
entry_widget['xscrollcommand']=scroll_widget.set scroll_widget['command']=entry_widget.xview
The change in module Tkinter is:
def xview(self,*args): """Query and change horizontal position of the view.""" #modify if not args: return self._getdoubles(self.tk.call(self._w, 'xview')) #old code index=args[0] self.tk.call(self._w, 'xview', index)
----------------------------------------------------------
I wish that this implementation could be integrated in Tkinter, and I remain at disposal for any question or further information.
Waiting for your response, Best regards Paolo Fraguglia
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.u...
-- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog
2009/8/14 paolo.fragu@libero.it <paolo.fragu@libero.it>:
Hi, I'm Paolo from Italy and I'm a python user. I wish to propose a useful and smart method modify in Tkinter Library:
Previously to scroll this widget we had to write an external function (recalling xview_moveto and xview_scroll).
With my method this operation is cleared and the same as all other widgets (just have to call xview).
I wish that this implementation could be integrated in Tkinter, and I remain at disposal for any question or further information.
Waiting for your response,
I believe you are trying to mention the fact that the Entry.xview method doesn't allow being called without passing an index, even if this index is None. Is that the case ? Take a look on http://bugs.python.org/issue1135 and http://bugs.python.org/issue6180, they already address this fix.
Best regards Paolo Fraguglia
Regards, -- -- Guilherme H. Polo Goncalves
participants (3)
-
Guilherme Polo -
Michael Foord -
paolo.fragu@libero.it