Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^3: Is there a Perl MVVM or MVP framework?

by halfcountplus (Hermit)
on Nov 13, 2009 at 19:51 UTC ( #807040=note: print w/replies, xml ) Need Help??

in reply to Re^2: Is there a Perl MVVM or MVP framework?
in thread Is there a Perl MVVM or MVP framework?

Okay, like I said, I have done some stuff with perl's Tk module. I've also done GUI programming in C with Gtk+.

GUI API's are "widget" oriented. A button is a widget. A text entry is a widget. A window is also a widget. Some widgets "belong" to other widgets -- perl's Tk module is object oriented. Usually there is considered to be a "top level" widget which is the eventual ancestor of all other widgets. The top level widget is a window.

So the widgets are perl objects created from widget classes, which some classes inherit from others. Ie, no, each window is not a package unto itself. TkCodex is pretty complex and in fact does use a database (via Storable, not SQL) but it is still all one file (1300 lines/45k -- I am not totally proud of the sometimes sloppy/dense looking code, but I still use it on a near daily basis and it has not required any bug fixes in a year).

That is the general scheme of all GUI libraries, whether in perl or not (altho in C there are no formal objects/classes, the idea is same). I would recommend Tk because it is a common perl package, and it is highly functional without being to hard to use. Gtk will likely match your destktop better on a linux box, and has probably some additional capacities if you want to embed 3D graphics, et al. Outside of linux, it may "clash" and is possibly harder to learn/use than Tk (certainly, the C library is...). Qt would be a good choice on windows or mac, but I notice perl/Qt has been unmaintained for a long time.

I also know there are tk and gtk programmers here at perlmonks -- they helped me. So take your pick and if you have a problem, this is the place to get assistance. Like I said before, and I can't stress this enough, do a small experimental project FIRST before you start fooling around seriously. Life will be much easier that way and the time it takes will be saved later because of the learning. An address book, or anything else you can think of to make into an SQL database, is ideal. You do not need to separate the GUI and the db code into separate packages (altho you can if you want). You just use the GUI buttons or whatever to issue queries, insertions, what-have-you (I'm presuming you've already done a bit of SQLite manipulation in perl using DBI), and you can display strings using "label" or "textarea" widgets.
  • Comment on Re^3: Is there a Perl MVVM or MVP framework?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://807040]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2023-10-03 10:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found