Which of the following options is not used to adjust the contents of a label?

If you provide both anchor1 and anchor2 options, the anchor0 option specifies how to display them.

anchor4Display the image below the text.anchor5Display only the image, not the text.anchor6Display the image to the left of the text.anchor7Display the image if there is one, otherwise display the text. This is the default value.anchor8Display the image to the right of the text.anchor9Display the text, not the image.width0Display the image above the text.

width1 Use this option to specify the appearance of the mouse cursor when it is over the widget; see Section 5.8, “Cursors”. The default value (an empty string) specifies that the cursor is inherited from the parent widget. width2 Use this option to specify the font style for the displayed anchor1. You may also specify this option using a style. width4 Use this option to specify the color of the displayed anchor1. You may also specify this option using a style. anchor2

This option specifies an image or images to be displayed either in addition to or instead of text. The value must be an image as specified in Section 5.9, “Images”. See the anchor0 option above for what happens when you supply both image and text.

You may specify multiple images that will appear on the widget depending on the state of the widget (see for a discussion of widget states). To do this, supply as the value of this option a tuple width8, width9, anchor0, anchor1, anchor2, ...), where:

  • anchor3 is the default image to be displayed on the widget.

  • For each pair of values after the first, anchor4 specifies a state or combination of states, and anchor0 specifies the image to be displayed when the widget's state matches anchor4.

    Each state specifier anchor4 may be a single state name, optionally preceded by anchor8, or a sequence of such names. The anchor9 specifies that the widget must not be in that state.

    For example, suppose you have three tk.W0 instances named tk.W1, tk.W2, and tk.W3, and in your call to the tk.W4 constructor you include this option:

    self.w = ttk.Label(self, ..., image=(im1, 'selected', im2, ('!disabled', 'alternate'), im3), ...)

    The widget will display image tk.W2 if it is in the tk.W6 state. If it is not in the tk.W6 state or the tk.W8 state but it is in the tk.W9 state, it will display image tk.W3. Otherwise it will display image tk.W1.

tk.CENTER2 If the anchor1 you provide contains newline (tk.CENTER4) characters, this option specifies how each line will be positioned horizontally: tk.CENTER5 to left-justify; tk.CENTER to center; or tk.CENTER7 to right-justify each line. You may also specify this option using a style. tk.CENTER8 To add more space around all four sides of the text and/or image, set this option to the desired dimension. You may also specify this option using a style. tk.CENTER9 Set this option to a relief style to create a 3-d effect. You will need to increase the borderwidth to make this effect appear. You may also specify this option using a style. tk.E1 Use this option to specify a custom widget style name; see . tk.E2

Use this option to specify whether the widget is visited during focus traversal; see Section 53, “Focus: routing keyboard input”. Specify tk.E3 if you want the visit to accept focus; specify tk.E4 if the widget is not to accept focus.

anchor1 A string of text to be displayed in the widget. tk.E6 A tk.E7 instance (see Section 52, “Control variables: the values behind the widgets”); the text displayed on the widget will be its value. If both anchor1 and tk.E6 are specified, the anchor1 option will be ignored. background1

You can request that one of the letters in the text string be underline by setting this option to the position of that letter. For example, the options background2 and background3 would underline the Q.

Using this option doesn't change anything functionally. If you want the application to react to the Q key or some variation like control-shift-Q, you'll need to set up the bindings using the event system.

width

To specify a fixed width, set this option to the number of characters. To specify a minimum width, set this option to minus the number of characters. If you don't specify this option, the size of the label area will be just enough to accommodate the current text and/or image.

For text displayed in a proportional font, the actual width of the widget will be based on the average width of a character in the font, and not a specific number of characters.

Which of the following is not a commonly used property of a text box?

Option “A” is the correct answer i.e. captions. The Caption property is the most communal property that exhibits text on the control for example a command button and a label. Text Box controls do not allow the Caption property.

What property is used when the application first starts up to set the location?

The OnStart property runs when the user starts the app.

Toplist

Neuester Beitrag

Stichworte