[ Pobierz całość w formacie PDF ]
.invoke( ) Invokes the Perl subroutine associated with the button, if any. A.1.1 RadiobuttonTable A.3: Radiobutton Properties and MethodsProperties Descriptioncommand Specifies a reference to a Perl subroutine, which is called when mouse button 1 (bydefault) is released over the radiobutton.The variable associated with "variable" isupdated before the command is invoked.variable Takes a reference to a variable and updates it with the "value" property's value when thebutton is clicked.Conversely, when it is updated to have the same value as the "value"property, it selects the button (or deselects it in all other cases).value Specifies the value to store in the button's associated variable whenever this button isselected.Methodsselect( ) Selects the radiobutton and sets the associated variable to the value corresponding to thiswidget.flash( ) Flashes the button by briefly toggling its colors.invoke( ) Invokes the Perl subroutine associated with the button, if any.A.1.2 CheckbuttonTable A.4: Checkbutton Properties and MethodsProperties Descriptioncommand Specifies a reference to a Perl subroutine, which is called when mouse button 1 (bydefault) is released over the button.The variable associated with "variable" isupdated before the command is invoked.variable Takes a reference to a variable and updates it with the "onvalue" or "offvalue"property's value, depending upon the state of the indicator.Conversely, when it isupdated, it matches itself with one of these values and appropriately selects ordeselects itself.onvalue, offvalue Toggles the indicator depending upon which of these values match the variable'svalue.They default to 1 and 0, respectively.indicatoron If false, it does not display the indicator.Instead, it toggles the "relief" property ofthe entire widget (which makes it looked like a pressed button).Methods select( ) Selects the checkbutton and sets the associated variable to the "onvalue" value.flash( ) Flashes the button by briefly toggling its colors.invoke( ) Invokes the Perl subroutine associated with the command property, if any.toggle( ) Toggles the selection state and the variables value of the button.Previous: 20.8 Advanced Perl Next: A.2Resources Programming Canvas20.8 Resources A.2 CanvasBookIndex[ Library Home | Perl in a Nutshell | Learning Perl | Learning Perl on Win32 | Programming Perl | Advanced PerlProgramming | Perl Cookbook ] Appendix APrevious: A.1 Next: A.3Tk Widget ReferenceButton EntryA.2 CanvasTable A.5 shows the properties of each item that is supported by the canvas widget and configured byusing the widget's itemconfigure method.The widget itself has no particularly interesting properties.However, the methods shown in the latter half of the table are the widget's, even if they mostly apply tothe individual canvas item types.Please note that all methods that take an item ID as a parameter can alsotake a preconfigured tag name as a parameter.Table A.5: Canvas ClassItem Properties DescriptionCommon propertiesfill, outline Colors for filling the region and outline.tags A list of strings.These are tags applicable to thisitem.You can add more to this list with addtag.stipple, outlinestipple Draw the interior or outline with a stipple pattern.The bitmap value specifies the stipple pattern.width Width of the outline.Arcstart, extent Angles in degrees, moving counterclockwise.style pieslice, chord, arc.In the last case, thefill option is ignored.Bitmapanchor As in widget properties shown earlier.bitmap The bitmap to display.background, foreground Colors for each of the bitmap pixels.Image anchor As in widget properties shown earlier.image The image to display.Linearrow First, last, both, or none.The end at whichan arrow should be drawn.arrowshape A reference to a list containing three dimensionsa, b, and c like this:fill Color.smooth, splinesteps If 1, draws a bezier curve instead of a polyline.Each spline is approximated with the number ofspline steps.Polygonsmooth, splinesteps See "Line" above.OvalStandard item propertiesRectangleStandard item propertiesTexttext, anchor Position text with respect to anchor.justify Text justification: left, right, or center.Windowwindow Specifies the widget to associate with this item.The widget must have been created as the canvas'schild.Methodscreate (type, x, y [x1, y1], [options.]) Type can be one of the above item types(non-capitalized).Returns a unique integer ID.itemconfigure (ID, options.) Configures one or more of the above parameters.addtag, dtag Add tags to items and delete them.Please see Tkdocumentation for tag specifications. bind Discussed in the section "Event Bindings".coords (ID [x0, y0.] ), move (id, xamount, Move the item to the new location.coords is anyamount) absolute move, while move does it relative tocurrent position.delete (ID, [ID,.] ) Delete the item (or items) that correspond to thetag or ID.find (searchCommand? arg.? ) Find all items that meet a certain constraint [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • higrostat.htw.pl
  •