Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Just starting to play with Prima. Wrote the following code:
use strict; use warnings; use Prima qw(Application Edit Buttons); my $window = new Prima::MainWindow( size => [ 250, 350] ); my $display_field = $window->insert( Edit => size => [ 200, 300], text => '', centered => 1, ); my $butoon = $window->insert( Button => size => [ 50, 20], text => 'Click', place => { x => 120, y => 340 }, onClick => \&button_Click, ); sub button_Click { for (1..5) { $display_field->insert_text("$_\n\n"); } } run Prima;
I expected the display field shows 1 2 3 4 and 5 separately in each line from top to bottom but Prima gives me 5 4 3 2 1. Things get displayed upside down.

I've noticed the x and y coordinates in Prima are different. For example, the x coordinate in Prima starts from left bottom corner of the widget, rather than the usual left top corner. I've found some seemingly relevant methods like translate, but I cant't seem to figure out how to get things displayed the expected way? Does someone have some ideas?

Thanks in advance.

In reply to How can I get Prima to display things from top to bottom? by ZJ.Mike.2009

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 having an uproarious good time at the Monastery: (3)
As of 2024-04-25 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found