title: Perl Tkx examples or tutorials
body: <p>I been trying to create Perl GUI using Tkx but I'm having trouble with a couple of issues.</p>
  
  <p>i have been looking at these sites:</p>
  
  <p><a href="http://rainbow.ldeo.columbia.edu/documentation/tkperl/" rel="nofollow">http://rainbow.ldeo.columbia.edu/documentation/tkperl/</a></p>
  
  <p><a href="http://docs.activestate.com/activetcl/8.5/tcl/tk_contents.htm" rel="nofollow">http://docs.activestate.com/activetcl/8.5/tcl/tk_contents.htm</a></p>
  
  <p><a href="http://www.tkdocs.com/tutorial/onepage.html" rel="nofollow">http://www.tkdocs.com/tutorial/onepage.html</a></p>
  
  <p>But the problem is that the examples do not seem to be working for me.</p>
  
  <p>I want to use an Object oriented approach as much as possible, but without using moose(for now) so i can get my head around how objects work in Perl.</p>
  
  <p>Edit: <a href="http://www.perltricks.com/article/25/2013/5/20/Old-School-Object-Oriented-Perl" rel="nofollow">link</a> to a good oo tutorial</p>
  
  <p>So I can already create a window:</p>
  
  <pre><code>sub main
  {
      my $mainWindow = Tkx::widget-&gt;new(".");
      $mainWindow-&gt;g_wm_title("FixViewer");
      $mainWindow-&gt;g_wm_minsize(400,500);
  
      Tkx::MainLoop();
  }
  </code></pre>
  
  <p>How do I create a frame and put a Gridlayout on it?</p>
  
  <p>Would someone be able to show me how, or link me to a good tutorial.</p>
  
  <p>Thanks</p>
  
  <h2>Update:</h2>
  
  <pre><code>use strict;
  use warnings;
  use Tkx;
  
  sub main
  {
      my $mainWindow = Tkx::widget-&gt;new(".");
      $mainWindow-&gt;g_wm_title("FixViewer");
      $mainWindow-&gt;g_wm_minsize(100,100);
  
      my $contentFrame = $mainWindow-&gt;new_ttk__frame(-padding =&gt; "3 3 12 12");
      $contentFrame-&gt;g_grid(-column =&gt; 0, -row =&gt; 0, -sticky =&gt; "nwes");
      $mainWindow-&gt;g_grid_columnconfigure(0, -weight =&gt; 1);
      $mainWindow-&gt;g_grid_rowconfigure(0, -weight =&gt; 1);
  
      my $input;
      my $output;
  
      #create a textbox where user can enter input
      my $inputbox = $contentFrame-&gt;new_ttk__entry(-width =&gt; 7, -textvariable =&gt; \$input);
      $inputbox-&gt;g_grid(-column =&gt; 1, -row =&gt; 1, -sticky =&gt; "we");
  
      #create a lable which shows whatever is input in the input box
      my $inputlabel = $contentFrame-&gt;new_ttk__label(-textvariable =&gt; \$output);
      $inputlabel-&gt;g_grid(-column =&gt; 1, -row =&gt; 2, -sticky =&gt; "we");
  
      #create a button and bind a sub to it
      my $button = $contentFrame-&gt;new_ttk__button(-text=&gt; "Click me",-command=&gt; sub {dostuff(\$output,\$input);} );
      $button-&gt;g_grid(-column =&gt; 1, -row =&gt; 3, -sticky =&gt; "w");
  
      #bind return key to method, so method will get called when key is hit
      $mainWindow-&gt;g_bind("&lt;Return&gt;",sub {dostuff(\$output,\$input);});
  
      Tkx::MainLoop;
  }
  
  sub dostuff
  {
      my $output = shift;
      my $input = shift;
      $$output = $$input;
  }
  
  #############
  # Call main #
  &amp;main();
  #############
  </code></pre>
  
  <p>I managed to kinda figure some stuff out. More examples or links to tutorials are still very welcome</p>