{"id":6793,"date":"2022-12-20T19:33:39","date_gmt":"2022-12-20T22:33:39","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/cursesuicontainer-man3\/"},"modified":"2022-12-20T19:33:39","modified_gmt":"2022-12-20T22:33:39","slug":"cursesuicontainer-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/cursesuicontainer-man3\/","title":{"rendered":"Curses::UI::Container (man3)"},"content":{"rendered":"<h1 align=\"center\">Curses::UI::Container<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#CLASS HIERARCHY\">CLASS HIERARCHY<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#STANDARD OPTIONS\">STANDARD OPTIONS<\/a><br \/> <a href=\"#WIDGET-SPECIFIC OPTIONS\">WIDGET-SPECIFIC OPTIONS<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#DEFAULT BINDINGS\">DEFAULT BINDINGS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI::Container \u2212 Create and manipulate container widgets<\/p>\n<h2>CLASS HIERARCHY <a name=\"CLASS HIERARCHY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI::Widget <br \/> | <br \/> +\u2212\u2212\u2212\u2212Curses::UI::Container<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use Curses::UI; <br \/> my $cui = new Curses::UI; <br \/> my $win = $cui\u2212>add(&#8216;window_id&#8217;, &#8216;Window&#8217;); <br \/> my $container = $win\u2212>add( <br \/> &#8216;mycontainer&#8217;, &#8216;Container&#8217; <br \/> ); <br \/> $container\u2212>add( <br \/> &#8216;contained&#8217;, &#8216;SomeWidget&#8217;, <br \/> &#8230;.. <br \/> ); <br \/> $container\u2212>focus();<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A container provides an easy way of managing multiple widgets in a single &#8220;form&#8221;. A lot of Curses::UI functionality is built around containers. The main class Curses::UI itself is a container. A Curses::UI::Window is a container. Some of the widgets are implemented as containers.<\/p>\n<h2>STANDARD OPTIONS <a name=\"STANDARD OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212parent<\/b>, <b>\u2212x<\/b>, <b>\u2212y<\/b>, <b>\u2212width<\/b>, <b>\u2212height<\/b>, <b>\u2212pad<\/b>, <b>\u2212padleft<\/b>, <b>\u2212padright<\/b>, <b>\u2212padtop<\/b>, <b>\u2212padbottom<\/b>, <b>\u2212ipad<\/b>, <b>\u2212ipadleft<\/b>, <b>\u2212ipadright<\/b>, <b>\u2212ipadtop<\/b>, <b>\u2212ipadbottom<\/b>, <b>\u2212title<\/b>, <b>\u2212titlefullwidth<\/b>, <b>\u2212titlereverse<\/b>, <b>\u2212onfocus<\/b>, <b>\u2212onblur<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For an explanation of these standard options, see Curses::UI::Widget.<\/p>\n<h2>WIDGET-SPECIFIC OPTIONS <a name=\"WIDGET-SPECIFIC OPTIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"20%\">\n<p style=\"margin-top: 1em\"><b>\u2212releasefocus<\/b><\/p>\n<\/td>\n<td width=\"63%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If this option is set, the widgets inside this Container will be part of the focus ordering of the parent widget. This means that when this Container gets the focus, its first widget will be focused. When the focus leaves the last widget inside the Container it will give the focus back to the parent instead of cycling back to the first widget in this Container. This option is useful to create a sub-class packed with common used widgets, making the reuse easier.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"11%\">\n<p style=\"margin-top: 1em\"><b>new<\/b> ( )<\/p>\n<\/td>\n<td width=\"72%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Create a new instance of the Curses::UI::Container class.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"40%\">\n<p style=\"margin-top: 1em\"><b>add<\/b> ( <small>ID, CLASS, OPTIONS<\/small> )<\/p>\n<\/td>\n<td width=\"43%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This is the main method for this class. Using this method it is easy to add widgets to the container.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>ID<\/small> is an identifier that you want to use for the added widget. This may be any string you want. If you do not need an <small>ID,<\/small> you may also us an undefined value. The container will automatically create an <small>ID<\/small> for you.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The <small>CLASS<\/small> is the class which you want to add to the container. If <small>CLASS<\/small> does not contain \u2019::\u2019 or <small>CLASS<\/small> matches \u2019Dialog::&#8230;\u2019 then \u2019Curses::UI\u2019 will be prepended to it. This way you do not have to specifiy the full class name for widgets that are in the Curses::UI hierarchy. It is not necessary to call &#8220;use <small>CLASS&#8221;<\/small> yourself. The <b>add<\/b> method will call the <b>usemodule<\/b> method from Curses::UI to automatically load the module.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The hash <small>OPTIONS<\/small> contains the options that you want to pass on to the new instance of <small>CLASS.<\/small><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Example:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">$container\u2212>add( <br \/> &#8216;myid&#8217;, # ID <br \/> &#8216;Label&#8217;, # CLASS <br \/> \u2212text => &#8216;Hello, world!&#8217;, # OPTIONS <br \/> \u2212x => 10, <br \/> \u2212y => 5, <br \/> );<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"37%\">\n<p style=\"margin-top: 1em\"><b>delete_object<\/b> ( <small>WIDGET<\/small> )<\/p>\n<\/td>\n<td width=\"46%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method deletes the contained widget from the container.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"20%\">\n<p style=\"margin-top: 1em\"><b>delete<\/b> ( <small>ID<\/small> )<\/p>\n<\/td>\n<td width=\"63%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method deletes the contained widget with the given <small>ID<\/small> from the container.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"21%\">\n<p style=\"margin-top: 1em\"><b>hasa<\/b> ( <small>CLASS<\/small> )<\/p>\n<\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method returns true if the container contains one or more widgets of the class <small>CLASS.<\/small><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"15%\">\n<p style=\"margin-top: 1em\"><b>layout<\/b> ( )<\/p>\n<\/td>\n<td width=\"68%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Layout the Container and all its contained widgets.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"25%\">\n<p style=\"margin-top: 1em\"><b>draw<\/b> ( <small>BOOLEAN<\/small> )<\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Draw the Container and all its contained widgets. <br \/> If <small>BOOLEAN<\/small> is true, the screen will not update after drawing. By default this argument is false, so the screen will update after drawing the container.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"23%\">\n<p style=\"margin-top: 1em\"><b>intellidraw<\/b> ( )<\/p>\n<\/td>\n<td width=\"60%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">See Curses::UI::Widget for an explanation of this method.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"14%\">\n<p style=\"margin-top: 1em\"><b>focus<\/b> ( )<\/p>\n<\/td>\n<td width=\"69%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If the container contains no widgets, this routine will return immediately. Else the container will get focus.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">If the container gets focus, one of the contained widgets will get the focus. The returnvalue of this widget determines what has to be done next. Here are the possible cases:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">* The returnvalue is <b><small>LEAVE_CONTAINER<\/small><\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">As soon as a widget returns this value, the container <br \/> will loose its focus and return the returnvalue and the <br \/> last pressed key to the caller.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">* The returnvalue is <b><small>STAY_AT_FOCUSPOSITION<\/small><\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The container will not loose focus and the focus will stay <br \/> at the same widget of the container.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">* Any other returnvalue<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">The focus will go to the next widget in the container.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"20%\">\n<p style=\"margin-top: 1em\"><b>getobj<\/b> ( <small>ID<\/small> )<\/p>\n<\/td>\n<td width=\"63%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method returns the object reference of the contained widget with the given <small>ID.<\/small><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"23%\">\n<p style=\"margin-top: 1em\"><b>getfocusobj<\/b> ( )<\/p>\n<\/td>\n<td width=\"60%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method returns the object reference of the contained widget which currently has the focus.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"38%\">\n<p style=\"margin-top: 1em\"><b>set_focusorder<\/b> ( <small>IDLIST<\/small> )<\/p>\n<\/td>\n<td width=\"45%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Normally the order in which widgets get focused in a container is determined by the order in which they are added to the container. Use <b>set_focusorder<\/b> if you want a different focus order. <small>IDLIST<\/small> contains a list of id\u2019s.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"37%\">\n<p style=\"margin-top: 1em\"><b>set_draworder<\/b> ( <small>IDLIST<\/small> )<\/p>\n<\/td>\n<td width=\"46%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Normally the order in which widgets are drawn in a container is determined by the order in which they are added to the container. Use <b>set_draworder<\/b> if you want a different draw order. <small>IDLIST<\/small> contains a list of id\u2019s.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\"><b>loadmodule<\/b> ( <small>CLASS<\/small> )<\/p>\n<\/td>\n<td width=\"52%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This will load the module for the <small>CLASS.<\/small> If loading fails, the program will die.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"29%\">\n<p style=\"margin-top: 1em\"><b>onFocus<\/b> ( <small>CODEREF<\/small> )<\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method can be used to set the <b>\u2212onfocus<\/b> event handler (see above) after initialization of the widget.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"28%\">\n<p style=\"margin-top: 1em\"><b>onBlur<\/b> ( <small>CODEREF<\/small> )<\/p>\n<\/td>\n<td width=\"55%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method can be used to set the <b>\u2212onblur<\/b> event handler (see above) after initialization of the widget.<\/p>\n<h2>DEFAULT BINDINGS <a name=\"DEFAULT BINDINGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Since interacting is not handled by the container itself, but by the contained widgets, this class does not have any key bindings.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI,<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright (c) 2001\u22122002 Maurice Makaay. All rights reserved.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This package is free software and is provided &#8220;as is&#8221; without express or implied warranty. It may be used, redistributed and\/or modified under the same terms as perl itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Curses::UI::Container \u2212 Create and manipulate container widgets <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3161,3007],"class_list":["post-6793","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-cursesuicontainer","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6793"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6793\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}