免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2425 | 回复: 3
打印 上一主题 下一主题

对Prima中Input Lines Widget疑问 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-11 22:31 |只看该作者 |倒序浏览
请问怎样能获取在InputLine的内容?
Google和CPAN找了整天也找不到T.T
use Prima;
use Prima::Classes;
use Prima::InputLine;


package Form1Window;
use vars qw(@ISA);
@ISA = qw(Prima::MainWindow);

sub profile_default
{
    my $def = $_[ 0]-> SUPER::profile_default;
    my %prf = (
        sizeDontCare => 0,
        origin => [ 490, 403],
        name => 'Form1',
        originDontCare => 0,
        size => [ 528, 109],
        designScale => [ 6, 13],
    );
    @$def{keys %prf} = values %prf;
    return $def;
}

sub init
{
    my $self = shift;
    my %instances = map {$_ => {}} qw();
    my %profile = $self-> SUPER::init(@_);
    my %names   = ( q(Form1) => $self);
    $self-> lock;
    $names{InputLine1} = $names{Form1}-> insert( qq(Prima::InputLine) =>
        origin => [ 4, 4],
        name => 'InputLine1',
        size => [ 520, 97],
    );
    $self-> unlock;
    return %profile;
}

package Form1Auto;

use Prima::Application;
Form1Window-> create;
run Prima;



简单来说
就是把InputLine内使用者输入的
存入某变数内

[ 本帖最后由 lokchungk 于 2008-6-11 22:55 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-06-12 21:58 |只看该作者
http://cpan.uwinnipeg.ca/htdocs/Prima/Prima/InputLine.html中提及
======================================
The input line text data is contained in text property.
======================================

好像和我的问题有关.
在没有高手能指点一下我?

论坛徽章:
0
3 [报告]
发表于 2008-06-13 16:58 |只看该作者
难道没有人用Prima

论坛徽章:
0
4 [报告]
发表于 2008-06-13 21:50 |只看该作者

看了数个example,
和作者DK通了话,
还找不到解决方法...

再看了无数次CPAN上的Prima文件,
终于领悟到方法
=================================
onChange => sub{$variable = $_[0]-> text;},
=================================
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP