Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Prima vs. Tk

by batkins (Chaplain)
on Aug 22, 2003 at 22:51 UTC ( [id://285947]=perlquestion: print w/replies, xml ) Need Help??

batkins has asked for the wisdom of the Perl Monks concerning the following question:

I've been working on a Perl application in Tk for some time (obligatory plug), but I'm considering switching over to Prima. Prima has a lot of things going for it, such as:
  • a really clean design
  • active development (a stable release every month or two)
  • smaller distribution (1/3 the size of Tk as source; about 3/4 the size of Tk as a binary)
  • antialiased fonts
  • more object-orientation (and thus more extensibility)
But before I make the switch, though, I was wondering if anyone had any comments about Prima and how it compares to Tk. Also, there are a few features Tk has that I'd have to be able to use in order to switch to Prima:
  • an editable rich-text control (like Tk::Text)
  • the ability to set global options as with the resource database available from Tk
  • the ability to call a function similar to DoOneEvent rather than entering a gui loop (or the ability to set a timer)
  • something similar to Tk::Frame - a widget used only for grouping
Does anyone know if Prima supports these things?

Thanks,
Bill

Replies are listed 'Best First'.
Re: Prima vs. Tk
by hossman (Prior) on Aug 23, 2003 at 00:48 UTC

    I've never used Prima, but your post prompted my curiousity. Here's a few things I found while skimming the docs...

    • Prima::Edit seems to be a fairly full featured text editing box
    • The Prima::Object docs mention a profile_default method, and a profile_check_in method, along with teh concepts of a default profile per Object type, and custom profiles, and merging profiles ... but it wasn't immediately clear to me how all of that works, but It looks like it would be possible to define all of your resources once (or maybe once per class) and then get them each time you create an object.
    • Prima::Timer looks like a fairly useful timer class
    • Prima::FrameSet looks like it provides basic frame support
Re: Prima vs. Tk
by dbwiz (Curate) on Aug 23, 2003 at 10:55 UTC
Re: Prima vs. Tk
by rinceWind (Monsignor) on Aug 23, 2003 at 09:59 UTC
    One of the great advantages of Tk is its great availability across a wide variety of platforms.

    • Does Prima work on Windows?
    • Is there a ppm distribution for it? (Activestate don't seem to have it)

    I guess if it does work on windows, someone could easily build and make available a ppm distribution (CrazyInsomniac?)

    --
    I'm Not Just Another Perl Hacker

      It does work on Windows. According to the developers, it works on Win32, X, and OS/2. However, there doesn't seem to be a PPM, although there are Windows binaries on their site.
Re: Prima vs. Tk
by aquarium (Curate) on Aug 23, 2003 at 14:12 UTC
    afaik prima does not come standard with any major perl distribution yet. if that is the case, then there'll be a big issue for many people to install yet another module when most want instant gratification. the worst thing i hate about dependency modules/packages is that you have to stay in proper sync, ie the right version of a module to go with your software.
      The same is true of Tk.

        Actually, Tk does now come as a standard part of ActiveState's Perl 5.8 distribution.

        kelan


        Perl6 Grammar Student

Answers (Prima vs. Tk)
by dk (Chaplain) on Aug 24, 2003 at 14:37 UTC
    - Editable RT-control: doesn't exist. One can hack Prima::TextView so it would accept keystrokes - all of the underlying rendering mechanics already there, so it's not the real problem. The real problem is to design a viable API - file format, markup model, interface methods, shortcut keys, etc etc.

    - Global options - AFAIU Tk fiddles with XRDB, which is hard to incorporate into a portable toolkit. However, there is a limited set of options readable from XRDB, like,

    Prima*Widget*color: #003000

    - Tk::DoOneEvent == $::application-> yield

    - Any Prima::Widget descendant can be used for grouping, if the functionality you need is to group the children widgets inside.

    And yes - Prima does compile on 5.8.0 .

    Title edit by tye

      That's right. Prima::TextView written entirely in perl. The only reason it isn't editable is because the author didn't have a need for it (Prima::Edit is all he needed i suppose)
Re: Prima vs. Tk
by barrachois (Pilgrim) on Aug 23, 2003 at 20:58 UTC
    I was also intrigued enough by the discussion here to take a look at Prima. However, after trying to compile it and failing, one of the developers on their mailing list was kind enough to let me know that it doesn't yet compile under Perl 5.8.0.

    Oops.

    It might be nice if they mentioned that somewhere on their website..

      barrachois wrote:

      >> one of the developers on their mailing list was kind enough to let me know that it doesn't yet compile under Perl 5.8.0.

      Strange.

      I first read about Prima here about 15 minutes ago. Intrigued, I downloaded Prima-1.10-MSWin32-580.zip , unzipped it, ran the script ms_install.pl, changed directory to C:\Perl\site\lib\examples and tried several examples ... all in less time than it took me to write this up.

      I have perl, v5.8.0 Binary build 806 on my machine.

      True, I did not try to get the sources and compile Prima, so I cannont vouch for that :-).

      Rudif

      Not true. I built from source here on 5.8.0.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://285947]
Approved by ybiC
Front-paged by Courage
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found