Wx::WidgetMaker

Wx::WidgetMaker is a CGI.pm-like library for wxPerl.
Download

Wx::WidgetMaker Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Scott Lanning
  • Publisher web site:
  • http://search.cpan.org/~slanning/Wx-WidgetMaker-0.11/lib/Wx/WidgetMaker.pm

Wx::WidgetMaker Tags


Wx::WidgetMaker Description

Wx::WidgetMaker is a CGI.pm-like library for wxPerl. Wx::WidgetMaker is a CGI.pm-like library for wxPerl.SYNOPSIS use Wx::WidgetMaker; $dialog = Wx::Dialog->new(...); $q = Wx::WidgetMaker->new(-parent => $dialog); # The dialog "page" $pagesizer = Wx::BoxSizer->new(wxVERTICAL); # A "row" in the page $rowsizer = Wx::BoxSizer->new(wxHORIZONTAL); # "print" a control to a row $ctrl = $q->h1('H1 text'); $q->print($ctrl, $rowsizer); # Add the row to the page $q->print($rowsizer, $pagesizer); # A new row $rowsizer = Wx::BoxSizer->new(wxHORIZONTAL); # print a label and textfield in an array $ctrl2 = $q->password_field( -name => 'password', -default => 'blue', -size => 50, # window width, not number of chars -maxlength => 30, ); $q->print(, $rowsizer); # Add the row to the page $q->print($rowsizer, $pagesizer); # Add some buttons $rowsizer = Wx::BoxSizer->new(wxHORIZONTAL); $okbutton = $q->submit('ok', 'OK', wxID_OK); $cancelbutton = $q->submit('cancel', 'Cancel', wxID_CANCEL); $q->print(, $rowsizer); $q->print($rowsizer, $pagesizer); # Put widgets in the dialog as normal $dialog->SetAutoLayout(1); $dialog->SetSizer($pagesizer); $pagesizer->Fit($dialog); # Get dialog data if ($dialog->ShowModal() == wxID_OK) { $password = $q->param('password'); } $dialog->Destroy();When starting to learn wxPerl, it can be frustrating trying to figure out which widgets handle what functionality. If you've ever done CGI development, you soon realize why it's not a bad idea to leverage the web browser as a graphical user interface: it can be complicated to implement functionality that you take for granted as an HTML/CGI developer.This module tries to make implementing wxPerl dialogs friendlier to a Perl CGI programmer by using an API similar to CGI.pm. (Specifically, it supports what I consider to be a useful/relevant subset of CGI.pm's :standard export tags.) It tries to adhere as faithfully as reasonable to the CGI API where applicable, and otherwise to try to do something intuitive.Every form-related method (popup_menu, textfield, etc.) requires a -name parameter. It serves the same purpose as in CGI.pm. The values the user has entered/selected on the form are accessible through $q->param('somename') where 'somename' was given as a -name argument. Requirements: · Perl


Wx::WidgetMaker Related Software