Skip to Content
Perl To Python Migration
book

Perl To Python Migration

by Martin C. Brown
November 2001
Beginner
320 pages
5h 53m
English
Pearson Business
Content preview from Perl To Python Migration

DIALOG BOX SAMPLE

For one final example, here are two scripts which define functions for creating simple dialog boxes in Tk. The Perl version is shown below. The dialog box accepts a list of arguments which set the parent widget, dialog box title, lead-in text, bitmap, the default button selection (activated when you press Return), and a list of further button options. The return value is the number of the button that was pressed, or zero if the default was selected.

 #! /usr/local/bin/perl -w use Tk; sub dialog { my ($master, $title, $text, $bitmap, $default, @butdefs) = @_; $w = MainWindow->new(); $w->title($title); $w->iconname('Dialog'); $top = $w->Frame(relief => 'raised', borderwidth => 1); $top->pack(side => 'top', fill => 'both'); $bot ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl by Example

Perl by Example

Ellie Quigley
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 0201734885Purchase book