Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problem with adding entries with periods in HList?
Can anyone clue me into why "line2" in the following cannot be added
as a line in a Tk HList?  I get:

parent element "This . is . another . line" does not exist at
/usr/local/lib/perl5/site_perl/5.6.1/i686-linux/Tk.pm line 228.

It seems like any string containing a "." cannot
be added as an entry?  But I'm unclear as to why that is.  I could add
it by specifying the path as '' instead of $line2, but then the line
is
not selectable.

Thanks in advance.

-- Dan

-----
#!/usr/local/bin/perl -w

# Silly TK test example using HList
#

use Tk;
use Tk::DialogBox;
use Tk::Tree;
use Tk::BrowseEntry;

main();

sub main {
my $main_window;
my $hlist;

my $line1 = "This is a line";
my $line2 = "This . is . another . line.";

$main_window =  MainWindow->new();
$main_window->title( "Blah" );
$main_window->geometry( "510x400+40+40" );
$hlist =
$main_window->Scrolled(
"HList",
"width" => 20,
"height" => 20,
"background" => "#EFEFEF",
"selectbackground" => "#C0C0FF",
"selectmode" => "extended",
"relief" => "groove",
-scrollbars => "osoe"
)->place(
-x => 120,
-y => 75
);

$hlist->add( $line1, -text => $line1 );
$hlist->add( $line2, -text => $line2 );
MainLoop();
}
-----

Report this thread to moderator Post Follow-up to this message
Old Post
dsyu@opposite-of-cold-mail.com
06-16-04 08:59 AM


Re: Problem with adding entries with periods in HList?
In article <ba0c1848.0406151736.7bcfcaaa@posting.google.com>, danhoo@gmail.com says...[colo
r=darkred]
> Can anyone clue me into why "line2" in the following cannot be added
> as a line in a Tk HList?  I get:
>
> parent element "This . is . another . line" does not exist at
> /usr/local/lib/perl5/site_perl/5.6.1/i686-linux/Tk.pm line 228.
>
> It seems like any string containing a "." cannot
> be added as an entry?  But I'm unclear as to why that is.  I could add
> it by specifying the path as '' instead of $line2, but then the line
> is not selectable.[/color]

From the Tk::HList pod:

Name: separator
Class: Separator
Switch: -separator

Specifies the character to used as the separator character
when intepreting the path-names of list entries. By default
the character "." is used.

> Thanks in advance.
>
> -- Dan
>
> -----
> #!/usr/local/bin/perl -w
>
> # Silly TK test example using HList
> #
>
> use Tk;
> use Tk::DialogBox;
> use Tk::Tree;
> use Tk::BrowseEntry;
>
> main();
>
> sub main {
>     my $main_window;
>     my $hlist;
>
>     my $line1 = "This is a line";
>     my $line2 = "This . is . another . line.";
>
>     $main_window =  MainWindow->new();
>     $main_window->title( "Blah" );
>     $main_window->geometry( "510x400+40+40" );
>     $hlist =
>         $main_window->Scrolled(
>             "HList",
>             "width" => 20,
>             "height" => 20,
>             "background" => "#EFEFEF",
>             "selectbackground" => "#C0C0FF",
>             "selectmode" => "extended",
>             "relief" => "groove",
>             -scrollbars => "osoe"
>         )->place(
>             -x => 120,
>             -y => 75
>         );
>
>     $hlist->add( $line1, -text => $line1 );
>     $hlist->add( $line2, -text => $line2 );
>     MainLoop();
> }
> -----
>

--
Go to http://MarcDashevsky.com to send me e-mail.

Report this thread to moderator Post Follow-up to this message
Old Post
Marc Dashevsky
06-16-04 08:59 AM


Re: Problem with adding entries with periods in HList?
Marc Dashevsky <usenet@MarcDashevsky.com> wrote in message news:<MPG.1b3972381717114b98997c
@netnews.comcast.net>...
>
> From the Tk::HList pod:
>
>     Name: separator
>     Class: Separator
>     Switch: -separator
>
>     Specifies the character to used as the separator character
>     when intepreting the path-names of list entries. By default
>     the character "." is used.
>
That's it!  Thanks Marc!

-- Dan

Report this thread to moderator Post Follow-up to this message
Old Post
dsyu@opposite-of-cold-mail.com
06-17-04 01:57 AM


Re: Problem with adding entries with periods in HList?
Marc Dashevsky <usenet@MarcDashevsky.com> wrote in message news:<MPG.1b3972381717114b98997c
@netnews.comcast.net>...
>
> From the Tk::HList pod:
>
>     Name: separator
>     Class: Separator
>     Switch: -separator
>
>     Specifies the character to used as the separator character
>     when intepreting the path-names of list entries. By default
>     the character "." is used.
>
That's it!  Thanks Marc!

-- Dan

Report this thread to moderator Post Follow-up to this message
Old Post
dsyu@opposite-of-cold-mail.com
06-17-04 01:57 AM


Re: Problem with adding entries with periods in HList?
Marc Dashevsky <usenet@MarcDashevsky.com> wrote in message news:<MPG.1b3972381717114b98997c
@netnews.comcast.net>...
> From the Tk::HList pod:
>
>     Name: separator
>     Class: Separator
>     Switch: -separator
>
>     Specifies the character to used as the separator character
>     when intepreting the path-names of list entries. By default
>     the character "." is used.
>

Thanks Marc, that's it!

-- Dan

Report this thread to moderator Post Follow-up to this message
Old Post
dsyu@opposite-of-cold-mail.com
06-17-04 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PerlTk archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:20 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.