Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
and GTK2::GladeXML both fell into the category of unbuildable last time I tried on Win32

Yes, its a huge negative that there aren't ppms for the various Gtk2..., but there is hope, See Re: install Gtk2::GladeXML

I think Wx looks great and has the functionality I'd need, but all of the existing documentation is for the C++ version. You need to translate it to perl, and not all concepts map cleanly from one language to the other. And as the original poster pointed out, it's not trivial to deploy a WxPerl application.

They map well enough , honest. Start with http://wxperl.sourceforge.net/tutorial/tutorial1.html

Then download chm file here, Wx-Demo, and dont forget about the samples

Short version, wxFrame in perl is Wx::Frame, methods are called using arrow not dot.

For all other differences the documentaion contains notes like this

wxWindow::ClientToScreen

virtual void ClientToScreen(int* x, int* y) const

wxPerl note: In wxPerl this method returns a 2-element list instead of modifying its parameters.

virtual wxPoint ClientToScreen(const wxPoint& pt) const

Converts to screen coordinates from coordinates relative to this window.

x

      A pointer to a integer value for the x coordinate. Pass the client coordinate in, and a screen coordinate will be passed out.

y

      A pointer to a integer value for the y coordinate. Pass the client coordinate in, and a screen coordinate will be passed out.

pt

      The client position for the second form of the function.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

      ClientToScreen(point) Accepts and returns a wxPoint
      ClientToScreenXY(x, y) Returns a 2-tuple, (x, y)

so in wxperl this maps pretty much the same. So you can use any of these
$ perl -MWx -le"print for Wx::Window->new->ClientToScreen( 0,0 )" 0 0 $ perl -MWx -le"print for Wx::Window->new->ClientToScreen( [0,0] )" Wx::Point=SCALAR(0x98a3c4) $ perl -MWx -le"print for Wx::Window->new->ClientToScreen( Wx::Point-> +new( 0,0 ) )" Wx::Point=SCALAR(0xda76e4)
In perl [ -1, -1 ] is a shortcut for wxPoint or wxSize depending on context.

Heres a hint to how wxPerl does overloading
$ perl -MWx -le"print for grep /clienttoscreen/i, keys %Wx::Window::" ClientToScreenPoint ClientToScreen ClientToScreenXY
So you could also write
$ perl -MWx -le"print for Wx::Window->new->ClientToScreenXY( 0,0 )" 0 0 $ perl -MWx -le"print for Wx::Window->new->ClientToScreenPoint( [0,0] + )" Wx::Point=SCALAR(0x3e8b64) $ perl -MWx -le"print for Wx::Window->new->ClientToScreenPoint( Wx::Po +int->new( 0,0 ) )" Wx::Point=SCALAR(0x9cf5c4)

In reply to Re^5: Packaging Perl Programs (is) Painful by Anonymous Monk
in thread Packaging Perl Programs (is) Painful by Sue D. Nymme

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-20 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found