ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcltk-perl
tcltk-perl
RE: [tcltk-perl] Re: Perl/Tk Aqua progress?
by Vadim Konovalov other posts by this author
Dec 8 2004 1:01AM messages near this date
RE: [tcltk-perl] Re: Perl/Tk Aqua progress? | [tcltk-perl] Re: Perl/Tk Aqua progress?
>  > 1) How does Tcl::Tk interact with Perl/Tk submodules.  For 
>  example, I 
>  > use Tk::ProgressBar::Mac to generate a progress bar.  
>  However, when I 
>  > try to use it with my mimimal changes, I get an error when 
>  I attempt to 
>  > call the widget.  Do I need to remove or rewrite any 
>  non-core widgets 
>  > that my script uses in order to use Tcl::Tk?

You can not use pure-perl perlTk  widgets.
However there exists a way to create pure-perl Tcl::Tk widgets.
But this design not decided and it is not documented - so you can't use this
either.

However I hope to solve this within a month (or may be two), so expect
positive answer to your question soon.

But usually it is easier to use existing Tcl/Tk widget:

Following one-liner on Win32 that shows BWidget's ProgressBar:
perl -MTcl::Tk=:perlTk -we
"$mw=tkinit;$mw-> Declare('ProgressBar','ProgressBar',-require=>'BWidget');$m
w-> ProgressBar(qw/-maximum 1000 -variable/,\$r)->pack for 0..9;
$r++,$mw-> update for 0..1000;MainLoop"

Note 'Declare' widget method of widget.

It creates ProgressBar widget in Tcl::Tk
It declares that widget of type 'ProgressBar' (1st arg) should use widget
'ProgressBar' (2nd arg) of Tcl/Tk and it requires 'BWidget' package (Tcl/Tk
script will use 'package require BWidget')
It provides great flexibility, and general Tcl/Tk widgets availability.

Once invoked, you can use ProgressBar anywhere in your program. (it is
called 10 times in my example)

(note to myself -- should document 'Declare' method clearly (as TODO comment
says))


>  > 
>  > 2) Does Tcl::Tk support drag and drop?  I had to comment out the 
>  > Tk::StartDrag and Tk::DragDrop calls in order for the script to run 
>  > under Tcl::Tk.

It was not implemented in Tcl::Tk's, so there is no perlTk compatibility WRT
Tk::StartDrag and Tk::DragDrop
As I currently understand, perlTk uses Drag-n-drop borrowed from Tix.
There exists also drag-n-drop in BWidget Tcl/Tk's package.

As using drag-n-drop from Tcl::Tk you can use either Tix one or BWidget's
one.
Both ways should be easily doable, 

Usually Tcl/Tk distribution comes with BWidget and without Tix.

Please see BWidget's demo from your Tcl/Tk installation to see which
drag-n-drop will be available to your Tcl::Tk scripts.



>  > 3) Are Pixmap window icons supported?

they should be... What code is not working?

>  > I don't mind porting some of my code over to the Tcl::Tk 
>  way of doing 
>  > things, but I'm not fluent in Tcl or the way this module 
>  does things, 
>  > whereas I've been working with Perl/Tk for 3-4 years now.  On first 
>  > glance, aside from a few problems, my app runs well by 
>  changing "use 
>  > Tk;" to "use Tcl::Tk qw(:perlTk);", which is both surprising and 
>  > encouraging.  Good work to the team for making at least the initial 
>  > stuff so easy!


The key point here - anything that does not works with Tcl::Tk but works in
perlTk could be easily adopted to Tcl::Tk. But with Tcl::Tk you will get
more avilability in general.

Also, it is planning to do distributions of Tcl::Tk with Tcl/Tk.

Best regards,
Vadim.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Tcltk-perl mailing list
Tcltk-perl@[...].net
https://lists.sourceforge.net/lists/listinfo/tcltk-perl

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved