-1

What the title says. I'm having a problem moving the textbox from a side to side. The code's long and it's about 200+ lines so I wont post it here. Anybody has an idea?

Rinrin
  • 33
  • 1
  • 3
  • 1
    Could you extract a small working peace of code to give us an example? – Alexey Gorozhanov Mar 31 '15 at 06:59
  • how can we possibly know what you're doing wrong without seeing your code? You don't have to post all 200+ lines -- reduce it down to the smallest number of lines that still i llustrates the problem. – Bryan Oakley Mar 31 '15 at 10:14

1 Answers1

0

You have various options for this, depending on what you mean by "text box," and whether you want to move it "by pixels" or "from a side to [another] side."

If you just want to display text, you can use a Label widget. If you want a text box where the user can enter text, try an Entry widget. If you want to move your widget from one area of the screen to another, you can use the grid geometry manager and simply use grid_forget to "unplace" your widget then grid (with different options than you originally used, of course) to put it somewhere else.

If you just have text and you'd like to move it pixel by pixel, you could create a Canvas and then use that widget's create_text method to create some text in a specific place on the Canvas. You can the use the Canvas widget's itemconfig method to move the text to a new location.

If you need something more complex than text, like an Entry widget, and you want to move it pixel by pixel, do the same as above but use the create_window method instead.

See Canvas, grid, Label, Entry, and these SO questions about create_window.

Community
  • 1
  • 1
TigerhawkT3
  • 48,464
  • 6
  • 60
  • 97