Skip to content

Adjusting visual feedback, with .bang()#274

Open
taconi wants to merge 1 commit intoQirky:masterfrom
taconi:bang
Open

Adjusting visual feedback, with .bang()#274
taconi wants to merge 1 commit intoQirky:masterfrom
taconi:bang

Conversation

@taconi
Copy link

@taconi taconi commented Jun 7, 2025

Demonstration

There is a video on YouTube demonstrating this functionality.
https://youtu.be/1STwy9P2bjg

How to test

Open FoxDotEditor and run the .bang() function as a parameter, for example:

d1 >> play('x', dur=2)
d1.bang(underline=True)

Which parameters the bang function accepts

I recommend experimenting with the parameters:

  • overstrike=1
  • underline=1
  • foreground='red'
  • background='#e24329'
  • font=('Consolas', 30)

Here is a table with all the options:

OPTION DESCRIPTION
background The background color for text with this tag. Note that you can't use bg as an abbreviation.
bgstipple To make the background appear grayish, set this option to one of the standard bitmap names (see Section 5.7, “Bitmaps”). This has no effect unless you also specify a background.
borderwidth Width of the border around text with this tag. Default is 0. Note that you can't use bd as an abbreviation.
fgstipple To make the text appear grayish, set this option a bitmap name.
font The font used to display text with this tag. See Section 5.4, “Type fonts”.
foreground The color used for text with this tag. Note that you can't use the fg abbreviation here.
justify The justify option set on the first character of each line determines how that line is justified: tk.LEFT (the default), tk.CENTER, or tk.RIGHT.
lmargin1 How much to indent the first line of a chunk of text that has this tag. The default is 0. See Section 5.1, “Dimensions” for allowable values.
lmargin2 How much to indent successive lines of a chunk of text that has this tag. The default is 0.
offset How much to raise (positive values) or lower (negative values) text with this tag relative to the baseline. Use this to get superscripts or subscripts, for example. For allowable values, see Section 5.1, “Dimensions”.
overstrike Set overstrike=1 to draw a horizontal line through the center of text with this tag.
relief Which 3-D effect to use for text with this tag. The default is relief=tk.FLAT; for other possible values see Section 5.6, “Relief styles”.
rmargin Size of the right margin for chunks of text with this tag. Default is 0.
spacing1 This option specifies how much extra vertical space is put above each line of text with this tag. If a line wraps, this space is added only before the first line it occupies on the display. Default is 0.
spacing2 This option specifies how much extra vertical space to add between displayed lines of text with this tag when a logical line wraps. Default is 0.
spacing3 This option specifies how much extra vertical space is added below each line of text with this tag. If a line wraps, this space is added only after the last line it occupies on the display. Default is 0.
tabs How tabs are expanded on lines with this tag. See Section 24.6, “Setting tabs in a Text widget”.
underline Set underline=1 to underline text with this tag.
wrap How long lines are wrapped in text with this tag. See the description of the wrap option for text widgets, above.

Table taken from the tkinter.Text().tag_config() documentation at: https://tkdocs.com/shipman/text-methods.html

for example:

```python
d2 >> play('x-', dur=2).bang(background='blue', foreground='black')
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant