Jump to content

Tkx formatting problems

- - - - -

  • Please log in to reply
No replies to this topic

#1
compgeek97

compgeek97

    Newbie

  • Members
  • Pip
  • 6 posts
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?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users