Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Tkx formatting problems

tic tac toe

  • Please log in to reply
No replies to this topic

#1 compgeek97

compgeek97

    CC Lurker

  • Just Joined
  • Pip
  • 6 posts

Posted 26 December 2011 - 03:14 PM

i have the following code
 for($i = 0, $i <= 8, $i++) { 
 use integer;
 $board[$i] = $mw->new_ttk__button(-textvariable => \$state[$i], -command => sub {btnPressed($i);}, -width => 3)
 ->g_grid(-row => ($i / 3) + 1, -column => ($i % 3) + 1);
 }
it is supposed to arrange a 3x3 grid of buttons on the root window(this is going to be tic tac toe). right now it's just giving me a single button(maybe all 8 in the same position)

what's wrong and how can i fix it?
  • 0





Also tagged with one or more of these keywords: tic tac toe