Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tk::popup(3pm) [debian man page]

Popup(3pm)						User Contributed Perl Documentation						Popup(3pm)

NAME
Tk::Wm::Popup - popup dialog windows. SYNOPSIS
$dialog->Popup(qw/ -popover => 'cursor' | $widget | undef, -overanchor => c | n | ne | e | se | s | sw | w | nw, -popanchor => c | n | ne | e | se | s | sw | w | nw, /); DESCRIPTION
You've probably had occasion to use a Dialog (or DialogBox) widget. These widgets are derived from a Toplevel (which is a subclass of Tk::Wm, the window manager) and spend most of their time in a withdrawn state. It's also common to use Toplevels as containers for custom built popup windows. Menus, too, are dialogs derived from the window manager class. For this discussion, we'll use the simple term dialog to refer any widget that pops up and awaits user interaction, whether it be a Menu, a special purpose Toplevel, or any of the dialog-type widgets, including, but not limited to, ColorEditor, Dialog, DialogBox, ErrorDialog, FileSelect, FBox, getOpenFile and getSaveFile. When it's time to display these dialogs, we call the Perl/Tk window manager Popup method. Popup accepts three special purpose options that specify placement information in high-level terms rather than numerical coordinates. It is Popup's responsibility to take our human specifications and turn them into actual screen coordinates before displaying the dialog. We can direct the dialog to appear in two general locations, either over another window (e.g. the root window (screen) or a particular widget), or over the cursor. This is called the popover location. Once we've made this decision we can further refine the exact placement of the dialog relative to the popover location by specifying the intersection of two anchor points. The popanchor point is associated with the dialog and the overanchor point is associated with the popover location (whether it be a window or the cursor). The point where the two anchor points coincide is the popup locus. Anchor points are string values and can be c (for center), or any of the eight cardinal compass points: n, ne, e, se, s, sw, w or nw. For example, if -popover specifies a widget, -popanchor is sw, and -overanchor is ne, the the dialog's southwest corner pops up at the widget's northeast corner. OPTIONS
The options recognized by Popup are as follows: -popover Specifies whether the dialog "pops over" a window or the cursor. It may be the string cursor, a widget reference, or undef for the root window. -popanchor Specifies the anchor point of the dialog. For instance, if e is specified, the right side of the dialog is the anchor. -overanchor Specifies where the dialog should anchor relative to the popover location. For instance, if e is specified the dialog appears over the right side of the popover location and if it's ne the the dialog is positioned at the upper-right corner of the popover location. AUTHOR
Nick Ing-Simmons, Steve Lidie This code is distributed under the same terms as Perl. perl v5.14.2 2010-05-29 Popup(3pm)

Check Out this Related Man Page

DialogBox(3)						User Contributed Perl Documentation					      DialogBox(3)

NAME
Tk::DialogBox - create and manipulate a dialog screen. SYNOPSIS
use Tk::DialogBox ... $d = $top->DialogBox(-title => "Title", -buttons => ["OK", "Cancel"]); $w = $d->add(Widget, args)->pack; ... $button = $d->Show; DESCRIPTION
DialogBox is very similar to Dialog except that it allows any widget in the top Frame. DialogBox creates two Frames, top and bottom. The bottom Frame shows all the specified Buttons, lined up from left to right. The top Frame acts as a container for all other widgets that can be added with the add() method. OPTIONS
The options recognized by DialogBox are as follows: -title Specify the title of the DialogBox. If this is not set, then the name of the program is used. -buttons The button names to display in the bottom Frame. This is a reference to an array of strings containing the text to put on each Button. There is no default value for this. If you do not specify any button names, no Buttons are displayed. -default_button Specifies the default Button that is considered invoked when user presses <Return> on the DialogBox. This Button is highlighted. If no default Button is specified, then the first element of the array whose reference is passed to the -buttons option is used as the default. -cancel_button Specifies the Button that is considered invoked when the user closes the DialogBox using the window manager's close button. If the -cancel_button option is not given, and if there's only one button configured, then this button is also used as the cancel button. Otherwise no button is considered as the cancel button; in such a case Show just returns "undef" when the user closes the DialogBox. -command A callback which is executed after invoking an action to close the DialogBox, but before restoring focus and grab information. The selected button is passed as the first argument. -focus Specify the widget to receive the initial focus after popping up the DialogBox. By default the -default_button widget receives the initial focus. -showcommand A callback which is executed before displaying the DialogBox and waiting for user input. The DialogBox itself is passed as the first argument. METHODS
DialogBox supports only two methods as of now: add(widget, options) Add the widget indicated by widget. Widget can be the name of any Tk widget (standard or contributed). options are the options that the widget accepts. The widget is advertized as a subwidget of DialogBox. The name of widget is lower-cased and used as the advertised name. If multiple instances of widget are created in the DialogBox, then only the last one gets the advertised name. add() does not automatically pack() or grid() widget into the DialogBox. Show(?-global?) Displays the Dialog until the user invokes one of the Buttons in the bottom Frame. If the grab type -global is specified, then Show uses that grab; otherwise it defaults to a local grab. Returns the name of the Button invoked. The actual Dialog is shown using the Popup method. Any other options supplied to Show are passed to Popup, and can be used to position the Dialog on the screen. Please read Tk::Popup for details. Exit() Close the dialogbox, by emulating a click on the default button. ADVERTISED WIDGETS
top The subwidget reference to the top half of the DialogBox widget, the Frame containing widgets added by the add method. bottom The subwidget reference to the bottom half of the DialogBox widget, the Frame containing the Button widgets. B_"button-text" Individual subwidget references to the Buttons in the DialogBox widget. The subwidget name is the string B_ concatenated with the Button's -text value. BUGS
There is no way of removing a widget once it has been added to the top Frame, unless you access the top subwidget and go through the child widgets. There is no control over the appearance of the Buttons in the bottom Frame nor is there any way to control the placement of the two Frames with respect to each other. AUTHOR
Rajappa Iyer rsi@earthling.net This code is distributed under the same terms as Perl. perl v5.16.3 2014-06-10 DialogBox(3)
Man Page