Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How to configure a HListplus widget

by ghosh123 (Monk)
on Feb 21, 2013 at 06:21 UTC ( #1019897=perlquestion: print w/ replies, xml ) Need Help??
ghosh123 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monk,

Suppose I have a Hlistplus widget with some data in it in some rows and under some column headers. Assume if I want to enter a new set of data in an already existing entryPaths, then how can I do that deleting the existing data in those rows.

while doing that I am getting following error :

XS_Tk__Callback_Call error:element "0" already exists at /user/perl_5.8.8/lib/Tk.pm line 250.
XS_Tk__Callback_Call: Command not found.

I am just copy/pasting a sample code here :

use Tk; use HListplus; my $mw = MainWindow->new(); # CREATE HEADER STYLE 1 my $headerstyle1 = $mw->ItemStyle( 'window', -anchor => 'nw', -pady => -10, -padx => 10, ); # CREATE MY HLIST my $hlist = $mw->Scrolled( 'HListplus', -scrollbars => 'oe', -columns => 2, -header => 1, -width => 40, -headerstyle => $headerstyle1, )->pack( -side => 'left', -expand => 'yes', -fill => 'both' ); # CREATE HEADER STYLE 2 my $headerstyle = $hlist->ItemStyle( 'window', -anchor => 'nw', -pady => 0, -padx => 10, ); $hlist->header( 'create', 0, -itemtype => 'resizebutton', -style => $headerstyle, -text => 'Test Name', -activebackground => 'white', ); $hlist->header( 'create', 1, -itemtype => 'resizebutton', -style => $headerstyle, -text => 'Status', -activebackground => 'white', ); my $red = $hlist->ItemStyle( 'text', -foreground => '#800000', -background => 'white' ); my $blue = $hlist->ItemStyle( 'text', -foreground => '#000080', -anchor => 'e', -background => 'white' ); foreach ( [ Joe => '$10,000' ], [ Peter => '$20,000' ], [ Raj => '$90, 000 something to make it very much wider' ], [ Zinh => '$0' ] ) { my $e = $hlist->addchild(""); $hlist->itemCreate( $e, 0, -itemtype => 'text', -text => $_->[0], -s +tyle => $red ); $hlist->itemCreate( $e, 1, -itemtype => 'text', -text => $_->[1], -s +tyle => $blue ); $hlist->selectionClear(); } Tk::MainLoop;

All I want to know is, if at a later point of time using this same $hlist object how can I enter a new set of data in the 0th and 1st entrypath instead of the existing Joe->$10,000 and Peter->$20,000

Thanks

Comment on How to configure a HListplus widget
Download Code
Re: How to configure a HListplus widget
by Anonymous Monk on Feb 21, 2013 at 08:13 UTC
    HListplus , seriously?

      What is your question ? I did not understand ...do you suggest me to use something else for this ?

        What is your question ?

        What is the name of the module you are using, which documentation are you reading?

Re: How to configure a HListplus widget
by zentara (Archbishop) on Feb 21, 2013 at 12:20 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1019897]
Approved by vinoth.ree
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-09-15 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls