<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ivaneeo's blog

    自由的力量,自由的生活。

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks

    一段簡單的使用wxperl的perl代碼:



    #!/usr/bin/perl
    #############################################################################
    ## Name:??????? samples/hello/hello.pl
    ## Purpose:???? Hello wxPerl sample
    ## Author:????? Mattia Barbon
    ## Modified by:
    ## Created:???? 02/11/2000
    ## RCS-ID:????? $Id: hello.pl,v 1.3 2004/10/19 20:28:14 mbarbon Exp $
    ## Copyright:?? (c) 2000 Mattia Barbon
    ## Licence:???? This program is free software; you can redistribute it and/or
    ##????????????? modify it under the same terms as Perl itself
    #############################################################################

    ##??????這里發覺只有使用Wx,Encode,Encode::CN,File::Glob這四個模塊才能通過perl2exe編譯。

    ##??????但是還有把wxbase26u_gcc_custom.dll,wxmsw26u_adv_gcc_custom.dll,wxmsw26u_core_gcc_custom.dll

    ##??????拷到目錄下才能運行。

    use strict;
    use Wx;
    use Encode;
    use Encode::CN;
    #use PerlIO;
    #use POSIX;;
    #use Getopt::Std;
    use File::Glob;


    # every program must have a Wx::App-derive class
    package MyApp;

    use vars qw(@ISA);

    @ISA = qw(Wx::App);

    # this is called automatically on object creation
    sub OnInit {
    ? my( $this ) = shift;

    ? # create a new frame
    ? my( $frame ) = MyFrame->new();

    ? # set as top frame
    ? $this->SetTopWindow( $frame );
    ? # show it
    ? $frame->Show( 1 );
    }

    package MyFrame;

    use vars qw(@ISA);

    @ISA = qw(Wx::Frame);

    use Wx::Event qw(EVT_PAINT);
    # this imports some constants
    use Wx qw(wxDECORATIVE wxNORMAL wxBOLD);
    use Wx qw(wxDefaultPosition);
    use Wx qw(wxWHITE);

    sub new {
    ? # new frame with no parent, id -1, title 'Hello, world!'
    ? # default position and size 350, 100
    ? my( $this ) = shift->SUPER::new( undef, -1, 'Hello, world!',
    ?????????????????????????????????? wxDefaultPosition , [350, 100] );

    ? # create a new font object and store it
    ? $this->{FONT} = Wx::Font->new( 40, wxDECORATIVE, wxNORMAL, wxBOLD, 0 );
    ? # set background colour
    ? $this->SetBackgroundColour( wxWHITE );

    ? $this->SetIcon( Wx::GetWxPerlIcon() );

    ? # declare that all paint events will be handled with the OnPaint method
    ? EVT_PAINT( $this, \&OnPaint );

    ? return $this;
    }

    sub OnPaint {
    ? my( $this, $event ) = @_;
    ? # create a device context (DC) used for drawing
    ? my( $dc ) = Wx::PaintDC->new( $this );

    ? # select the font
    ? $dc->SetFont( $this->font );
    ? # darw a friendly message
    ? $dc->DrawText( 'Hello, world!', 10, 10 );
    }

    sub font {
    ? $_[0]->{FONT};
    }

    package main;

    # create an instance of the Wx::App-derived class
    my( $app ) = MyApp->new();
    # start processing events
    $app->MainLoop();

    # Local variables: #
    # mode: cperl #
    # End: #


    我現在還不知是為什么。如果有哪位高手知道,告訴小弟一聲。

    謝謝!

    posted on 2006-04-18 20:27 ivaneeo 閱讀(1032) 評論(0)  編輯  收藏 所屬分類: perl-殺雞就要用牛刀
    主站蜘蛛池模板: 日本在线观看免费高清| 亚洲一区二区三区写真 | 日本免费中文字幕在线看| 亚洲乱码一二三四区麻豆| 日韩版码免费福利视频| 亚洲综合久久一本伊伊区| 24小时免费直播在线观看| 亚洲精品免费网站| 精品剧情v国产在免费线观看| 亚洲男人的天堂网站| 国产成人免费a在线资源| 青青草97国产精品免费观看| 国产极品美女高潮抽搐免费网站| 男男gay做爽爽免费视频| 亚洲AV无码乱码在线观看性色扶| 亚洲第一视频在线观看免费| 亚洲中文字幕在线第六区| 久久国产免费观看精品| 亚洲精品在线不卡| 成年人免费视频观看| 色噜噜的亚洲男人的天堂| 亚洲v国产v天堂a无码久久| 中文字幕的电影免费网站| 亚洲日韩区在线电影| 黄页网站免费观看| 国产精品亚洲色图| 亚洲国产精品成人精品无码区 | 丁香五月亚洲综合深深爱| 免费91最新地址永久入口 | 我们的2018在线观看免费高清| 在线亚洲午夜片AV大片| 亚洲AⅤ视频一区二区三区 | 在线观看日本免费a∨视频| 久久亚洲AV成人无码国产电影 | 亚洲国产AV无码专区亚洲AV| 亚洲免费观看在线视频| 国产AV无码专区亚洲AV琪琪| 亚洲国产精品成人精品无码区 | 亚洲国产精品不卡毛片a在线| 毛片在线播放免费观看| 亚洲国产精品一区二区三区在线观看|