5.12. TUI Add-on basic features


Anaconda also supports a text-based interface (TUI). This interface is more limited in its capabilities, but on some systems it might be the only choice for an interactive installation. For more information about differences between the text-based interface and graphical interface and about limitations of the TUI, see Introduction to Anaconda and add-ons.

注意

To add support for the text interface into your add-on, create a new set of subpackages under the tui directory as described in Anaconda add-on structure.

The text mode support in the installer is based on the simpleline library, which only allows very simple user interaction. The text mode interface:

  • Does not support cursor movement - instead, it acts like a line printer.
  • Does not support any visual enhancements, such as using different colors or fonts, for example.

Internally, the simpleline toolkit has three main classes: App, UIScreen and Widget. Widgets are units containing information to be printed on the screen. They are placed on UIScreens that are switched by a single instance of the App class. On top of the basic elements, hubs, spokes and dialogs all contain various widgets in a way similar to the graphical interface.

The most important classes for an add-on are NormalTUISpoke and various other classes defined in the pyanaconda.ui.tui.spokes package. All those classes are based on the TUIObject class, which itself is an equivalent of the GUIObject class. Each TUI spoke is a Python class inheriting from the NormalTUISpoke class, overriding special arguments and methods defined by the API. Because the text interface is simpler than the GUI, there are only two such arguments:

  • title - determines the title of the spoke, similar to the title argument in the GUI.
  • category - determines the category of the spoke as a string; the category name is not displayed anywhere, it is only used for grouping.
注意

The TUI handles categories differently than the GUI. Assign a pre-existing category to your new spoke. Creating a new category would require patching Anaconda, and brings little benefit.

Each spoke is also expected to override several methods, namely init, initialize, refresh, apply, execute, input, prompt, and properties (ready, completed, mandatory, and status).

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部