RE: Question on design

From: <>
Date: Tue, 31 May 2005 15:44:21 -0400

Hi Dave

Thanks very much for the reply, and the suggestion. I've been experimenting
with $::application->yield();, and have achieved some different results.
But the application still isn't working as I'd like.

Where should I place the '$::application->yield();' line, and how many of
them do I need?


-----Original Message-----
From: [] On Behalf
Of Dave Arnold
Sent: Tuesday, May 31, 2005 2:09 PM
Subject: Re: Question on design

In article
   <> wrote:

> I tried to create a very simple application to illustrate what I'm
> seeing:

> use Prima qw(Application);
> my $main = Prima::Window -> new (text => 'Hello world!');
> # Display the window, then wait for and print some input
> $main -> show();
> $line = <STDIN>;
> print $line;
> # Hide the window, then wait for and print some input
> $main -> hide();
> $line = <STDIN>;
> print $line;
> # Display the window, then wait for and print some input
> $main -> show();
> $line = <STDIN>;
> print $line;
> # Destroy the window
> $main -> destroy();

> The behavior I see is that the show() call does create the window with
> the create text, but the hourglass cursor appears over the window, and
> none of the objects in the window are displayed.

> What have I forgotten?

You will need to pass control to the application to allow it to perform any
update actions, e.g. redrawing. This is achieved using:


Prima, like most GUI based toolkits are based around an "event loop" that
calls all the appropriate parts of the toolkit. This event loop is started
by Prima->run() and doesn't return until the application is closed.

If you are performing actions based on input from a file or socket you
might consider using the Prima::File object: this allows a routine to be
called when there is input available.

Received on Tue 31 May 2005 - 21:44:30 CEST

This archive was generated by hypermail 2.2.0 : Wed 27 Mar 2013 - 10:40:22 CET