Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This was really helpful. I was also thinking of using hash for storing and re-positioning the text items upon clicking on up and down button. I proceeded as below but a bit stuck. Let us assume I have put your code in a subroutine called build_layout()

my $dynamic_hash = {0 => "job",1=> "state",2 =>"dependencies",3=>"resu +lt"}; &build_layout($init_hash); sub build_layout { ## samething what u have sent foreach my $itemkey (sort keys %$dynamic_hash) { my $btn=$text->Checkbutton(%attr_item,'-activebackground'=>'#ff7f7 +f' ); my $up=$text->Button(-text=>'Up',%attr_btn, -command => [\&moveup, +${$dynamic_hash}{$itemkey} ); my $down=$text->Button(-text=>'Down',%attr_btn,)-command => [\&mov +edown,${$dynamic_hash}{$itemkey}; ..... ..... $text->insert('1.0',sprintf('%-'.$item_width.'s',${$dynamic_hash}{ +$itemkey})); } sub moveup { my $text = shift ### not able to proceed here } sub movedown { }

In reply to Re^6: Insert checkbutton into MListbox by ghosh123
in thread Insert checkbutton into MListbox by ghosh123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-23 21:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found