sugar package
Subpackages
- sugar4.activity package
- Submodules
- sugar4.activity.activity module
- Activity
PREVIEW_SIZEActivityActivity.__init__()Activity.add_stop_button()Activity.iconify()Activity.show()Activity.run_main_loop()Activity.get_active()Activity.set_active()Activity.activeActivity.get_max_participants()Activity.set_max_participants()Activity.get_id()Activity.get_bundle_id()Activity.get_canvas()Activity.set_canvas()Activity.canvasActivity.get_activity_root()Activity.read_file()Activity.write_file()Activity.notify_user()Activity.get_preview()Activity.save()Activity.copy()Activity.get_shared_activity()Activity.get_shared()Activity.invite()Activity.share()Activity.can_close()Activity.close()Activity.get_metadata()Activity.metadataActivity.handle_view_source()Activity.get_document_path()Activity.busy()Activity.unbusy()
SimpleActivityget_bundle_name()get_bundle_path()get_activity_root()show_object_in_journal()launch_bundle()get_bundle()
- sugar4.activity.activityhandle module
- sugar4.activity.widgets module
- Module contents
- Activity Module
ActivityActivity.__init__()Activity.add_stop_button()Activity.busy()Activity.can_close()Activity.canvasActivity.close()Activity.copy()Activity.get_active()Activity.get_activity_root()Activity.get_bundle_id()Activity.get_canvas()Activity.get_document_path()Activity.get_id()Activity.get_max_participants()Activity.get_metadata()Activity.get_preview()Activity.get_shared()Activity.get_shared_activity()Activity.handle_view_source()Activity.iconify()Activity.invite()Activity.metadataActivity.notify_user()Activity.read_file()Activity.run_main_loop()Activity.save()Activity.set_active()Activity.set_canvas()Activity.set_max_participants()Activity.share()Activity.show()Activity.unbusy()Activity.write_file()
SimpleActivity
- sugar4.bundle package
- Submodules
- sugar4.bundle.activitybundle module
ActivityBundleActivityBundle.MIME_TYPEActivityBundle.__init__()ActivityBundle.get_locale_path()ActivityBundle.get_icons_path()ActivityBundle.get_name()ActivityBundle.get_bundle_id()ActivityBundle.get_icon()ActivityBundle.get_icon_filename()ActivityBundle.get_activity_version()ActivityBundle.get_command()ActivityBundle.get_mime_types()ActivityBundle.get_tags()ActivityBundle.get_summary()ActivityBundle.get_description()ActivityBundle.get_single_instance()ActivityBundle.get_max_participants()ActivityBundle.get_show_launcher()ActivityBundle.install()ActivityBundle.install_mime_type()ActivityBundle.uninstall()ActivityBundle.is_user_activity()
get_bundle_instance()
- sugar4.bundle.bundle module
- sugar4.bundle.bundleversion module
- sugar4.bundle.contentbundle module
ContentBundleContentBundle.MIME_TYPEContentBundle.__init__()ContentBundle.get_name()ContentBundle.get_library_version()ContentBundle.get_locale()ContentBundle.get_activity_start()ContentBundle.get_icon()ContentBundle.get_start_uri()ContentBundle.get_bundle_id()ContentBundle.get_activity_version()ContentBundle.get_tags()ContentBundle.install()ContentBundle.uninstall()ContentBundle.is_user_activity()
- sugar4.bundle.helpers module
- Module contents
- sugar4.datastore package
- sugar4.dispatch package
- sugar4.graphics package
- Submodules
- sugar4.graphics.alert module
- sugar4.graphics.animator module
- sugar4.graphics.icon module
- Icons
IconIcon.__init__()Icon.do_snapshot()Icon.do_measure()Icon.get_icon_name()Icon.set_icon_name()Icon.get_file_name()Icon.set_file_name()Icon.get_pixel_size()Icon.set_pixel_size()Icon.get_fill_color()Icon.set_fill_color()Icon.get_stroke_color()Icon.set_stroke_color()Icon.get_xo_color()Icon.set_xo_color()Icon.get_badge_name()Icon.set_badge_name()Icon.get_alpha()Icon.set_alpha()Icon.get_scale()Icon.set_scale()Icon.get_badge_size()Icon.get_pixbuf()Icon.set_pixbuf()Icon.get_gtk_image()
EventIconCanvasIconCellRendererIconget_icon_file_name()get_icon_state()get_surface()
- sugar4.graphics.menuitem module
- sugar4.graphics.objectchooser module
- sugar4.graphics.palette module
PalettePalette.__init__()Palette.get_full_size_request()Palette.popup()Palette.popdown()Palette.on_enter()Palette.set_primary_text()Palette.get_primary_text()Palette.set_secondary_text()Palette.get_secondary_text()Palette.set_icon()Palette.get_icon()Palette.set_icon_visible()Palette.get_icon_visible()Palette.set_content()Palette.get_label_width()Palette.get_menu()
PaletteActionBar
- sugar4.graphics.palettegroup module
- sugar4.graphics.palettemenu module
- sugar4.graphics.palettewindow module
MouseSpeedDetectorPaletteWindowPaletteWindow.__init__()PaletteWindow.destroy()PaletteWindow.set_invoker()PaletteWindow.get_invoker()PaletteWindow.set_content()PaletteWindow.is_up()PaletteWindow.set_group_id()PaletteWindow.get_group_id()PaletteWindow.update_position()PaletteWindow.get_full_size_request()PaletteWindow.popup()PaletteWindow.popdown()PaletteWindow.on_invoker_enter()PaletteWindow.on_invoker_leave()PaletteWindow.on_enter()PaletteWindow.on_leave()PaletteWindow.get_rect()
InvokerInvoker.ANCHOREDInvoker.AT_CURSORInvoker.BOTTOMInvoker.RIGHTInvoker.TOPInvoker.LEFTInvoker.__init__()Invoker.attach()Invoker.detach()Invoker.get_position_for_alignment()Invoker.get_position()Invoker.get_alignment()Invoker.has_rectangle_gap()Invoker.draw_rectangle()Invoker.notify_popup()Invoker.notify_popdown()Invoker.notify_mouse_enter()Invoker.notify_mouse_leave()Invoker.notify_right_click()Invoker.notify_toggle_state()Invoker.get_palette()Invoker.set_palette()Invoker.get_cache_palette()Invoker.set_cache_palette()Invoker.get_toggle_palette()Invoker.set_toggle_palette()Invoker.get_lock_palette()Invoker.set_lock_palette()Invoker.primary_text_clicked()Invoker.get_rect()Invoker.get_toplevel()
WidgetInvokerWidgetInvoker.__init__()WidgetInvoker.attach_widget()WidgetInvoker.detach()WidgetInvoker.get_rect()WidgetInvoker.has_rectangle_gap()WidgetInvoker.draw_rectangle()WidgetInvoker.get_widget()WidgetInvoker.set_widget()WidgetInvoker.get_toplevel()WidgetInvoker.notify_popup()WidgetInvoker.notify_popdown()
CursorInvokerToolInvokerTreeViewInvoker
- sugar4.graphics.radiopalette module
- sugar4.graphics.radiotoolbutton module
- sugar4.graphics.style module
- Style
FontColorzoom()apply_css_to_widget()ZOOM_FACTORDEFAULT_SPACINGDEFAULT_PADDINGGRID_CELL_SIZELINE_WIDTHSTANDARD_ICON_SIZESMALL_ICON_SIZEMEDIUM_ICON_SIZELARGE_ICON_SIZEXLARGE_ICON_SIZEFONT_SIZEFONT_FACEFONT_NORMALFONT_BOLDFONT_NORMAL_HFONT_BOLD_HFONT_ITALICCOLOR_BLACKCOLOR_WHITECOLOR_TRANSPARENTCOLOR_PANEL_GREYCOLOR_SELECTION_GREYCOLOR_TOOLBAR_GREYCOLOR_BUTTON_GREYCOLOR_INACTIVE_FILLCOLOR_INACTIVE_STROKECOLOR_TEXT_FIELD_GREYCOLOR_HIGHLIGHTCOLOR_PRIMARYCOLOR_SUCCESSCOLOR_WARNINGCOLOR_ERRORPALETTE_CURSOR_DISTANCETOOLBAR_ARROW_SIZEMENU_WIDTH_CHARSBORDER_RADIUSSHADOW_BLURTRANSITION_DURATION
- sugar4.graphics.toolbarbox module
- sugar4.graphics.toolbox module
- sugar4.graphics.combobox module
- sugar4.graphics.toolcombobox module
- sugar4.graphics.toggletoolbutton module
ToggleToolButtonToggleToolButton.__init__()ToggleToolButton.set_icon_name()ToggleToolButton.get_icon_name()ToggleToolButton.create_palette()ToggleToolButton.get_palette()ToggleToolButton.set_palette()ToggleToolButton.get_palette_invoker()ToggleToolButton.set_palette_invoker()ToggleToolButton.set_tooltip()ToggleToolButton.set_accelerator()ToggleToolButton.get_accelerator()ToggleToolButton.do_snapshot()ToggleToolButton.do_clicked()
- sugar4.graphics.toolbutton module
- ToolButton
setup_accelerator()ToolButtonToolButton.__init__()ToolButton.set_tooltip()ToolButton.get_tooltip()ToolButton.get_hide_tooltip_on_click()ToolButton.set_hide_tooltip_on_click()ToolButton.set_accelerator()ToolButton.get_accelerator()ToolButton.set_icon_name()ToolButton.get_icon_name()ToolButton.set_icon_widget()ToolButton.get_icon_widget()ToolButton.set_label()ToolButton.get_label()ToolButton.create_palette()ToolButton.get_palette()ToolButton.set_palette()ToolButton.get_palette_invoker()ToolButton.set_palette_invoker()ToolButton.do_snapshot()ToolButton.set_active()ToolButton.get_active()
- sugar4.graphics.window module
- Window Management
UnfullscreenButtonWindowWindow.__init__()Window.reveal()Window.is_fullscreen()Window.fullscreen()Window.unfullscreen()Window.set_canvas()Window.get_canvas()Window.set_toolbar_box()Window.get_toolbar_box()Window.set_tray()Window.add_alert()Window.remove_alert()Window.set_enable_fullscreen_mode()Window.get_enable_fullscreen_mode()Window.canvasWindow.toolbar_box
- sugar4.graphics.xocolor module
- Module contents
- Graphics Module
XoColorIconIcon.__init__()Icon.do_measure()Icon.do_snapshot()Icon.get_alpha()Icon.get_badge_name()Icon.get_badge_size()Icon.get_file_name()Icon.get_fill_color()Icon.get_gtk_image()Icon.get_icon_name()Icon.get_pixbuf()Icon.get_pixel_size()Icon.get_scale()Icon.get_stroke_color()Icon.get_xo_color()Icon.set_alpha()Icon.set_badge_name()Icon.set_file_name()Icon.set_fill_color()Icon.set_icon_name()Icon.set_pixbuf()Icon.set_pixel_size()Icon.set_scale()Icon.set_stroke_color()Icon.set_xo_color()
EventIconCanvasIconCellRendererIconget_icon_file_name()get_surface()get_icon_state()
- sugar4.presence package
- Submodules
- sugar4.presence.activity module
- sugar4.presence.buddy module
BaseBuddyBaseBuddy.__init__()BaseBuddy.get_key()BaseBuddy.set_key()BaseBuddy.get_nick()BaseBuddy.set_nick()BaseBuddy.get_color()BaseBuddy.set_color()BaseBuddy.get_current_activity()BaseBuddy.get_owner()BaseBuddy.set_owner()BaseBuddy.get_ip4_address()BaseBuddy.set_ip4_address()BaseBuddy.get_tags()BaseBuddy.set_tags()BaseBuddy.object_path()
BuddyOwner
- sugar4.presence.connectionmanager module
- sugar4.presence.presenceservice module
PresenceServicePresenceService.__init__()PresenceService.get_activity()PresenceService.get_activity_by_handle()PresenceService.get_buddy()PresenceService.get_buddy_by_telepathy_handle()PresenceService.get_owner()PresenceService.share_activity()PresenceService.get_preferred_connection()PresenceService.get()PresenceService.get_activities()PresenceService.get_activities_async()PresenceService.get_buddies()PresenceService.get_buddies_async()
get_instance()
- sugar4.presence.sugartubeconn module
- sugar4.presence.tubeconn module
- Module contents
Submodules
sugar4.env module
Calculates file-paths for the Sugar working environment
sugar4.logger module
Logging service setup.
STABLE.
- sugar4.logger.cleanup()[source]
Clean up the log directory, moving old logs into a numbered backup directory. We only keep _MAX_BACKUP_DIRS of these backup directories around; the rest are removed.
sugar4.mime module
MIME helpers based on freedesktop specification.
STABLE.
sugar4.network module
STABLE.
- class sugar4.network.GlibTCPServer(*args: Any, **kwargs: Any)[source]
Bases:
TCPServerIntegrate socket accept into glib mainloop.
- class sugar4.network.ChunkedGlibHTTPRequestHandler(*args: Any, **kwargs: Any)[source]
Bases:
SimpleHTTPRequestHandlerRequestHandler class that integrates with Glib mainloop. It writes the specified file to the client in chunks, returning control to the mainloop between chunks.
- send_head()[source]
Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied to the outputfile by the caller unless the command was HEAD, and must be closed by the caller under all circumstances), or None, in which case the caller has nothing further to do.
** [dcbw] modified to send Content-disposition filename too
sugar4.profile module
User settings/configuration loading.
sugar4.util module
Various utility functions
- sugar4.util.unique_id(data='')[source]
Generate a likely-unique ID for whatever purpose
data – suffix appended to working data before hashing
Returns a 40-character string with hexidecimal digits representing an SHA hash of the time, a random digit within a constrained range and the data passed.
- Note: these are not crypotographically secure or
globally unique identifiers. While they are likely to be unique-enough, no attempt is made to make perfectly unique values.
- sugar4.util.set_proc_title(title)[source]
Sets the process title so ps and top show more descriptive names. This does not modify argv[0] and only the first 15 characters will be shown.
- title – the title you wish to change the process
title to
Returns True on success. We don’t raise exceptions because if something goes wrong here it is not a big deal as this is intended as a nice thing to have for debugging
- class sugar4.util.LRU(count, pairs=[])[source]
Bases:
objectImplementation of a length-limited O(1) LRU queue. Built for and used by PyPE: http://pype.sourceforge.net Copyright 2003 Josiah Carlson.
Module contents
Sugar Toolkit GTK4 Python
A modern GTK4 port of the Sugar Toolkit for Python activities.
This package provides the core functionality needed to create Sugar activities using GTK4, maintaining compatibility with Sugar’s educational framework while leveraging modern GTK4 features.
- Modules:
activity: Core activity classes and functionality graphics: Visual components, styling, and UI widgets bundle: Activity bundle management
- class sugar4.Activity(*args: Any, **kwargs: Any)[source]
Bases:
WindowInitialise an Activity.
- Parameters:
handle (
ActivityHandle) – instance providing the activity id and access to the presence service which may provide sharing for this applicationcreate_jobject (boolean) – DEPRECATED: define if it should create a journal object if we are not resuming. The parameter is ignored, and always will be created a object in the Journal.
- Signals:
- shared - the activity has been shared on a network in
order that other users may join,
- joined - the activity has joined with other instances of
the activity to create a shared network activity.
closing - the activity is about to close
Side effects:
sets the display DPI setting (resolution) to the Sugar screen resolution.
connects our “close-request” signal to our close handling.
creates a base Gtk.ApplicationWindow within this window.
creates activity service handling for this application.
When your activity implements
__init__(), it must call theActivityclass__init__()before anyActivityspecific code.- add_stop_button(button)[source]
Register an extra stop button. Normally not required. Use only when an activity has more than the default stop button.
- Parameters:
button (
Gtk.Button) – a stop button
- busy()[source]
Show that the activity is busy. If used, must be called once before a lengthy operation, and
unbusy()must be called after the operation completes.self.busy() self.long_operation() self.unbusy()
- can_close()[source]
Return whether
close()is permitted.An activity may override this function to code extra checks before closing.
- close(skip_save=False)[source]
Save to the journal and stop the activity.
Activities should not override this method, but should implement
write_file()to do any state saving instead. If the activity wants to control whether it can close, it should overridecan_close().
- copy()[source]
Make a copy of the journal object.
Activities may use this to ‘Keep in Journal’ the current state of the activity. A new journal object will be created for the running activity.
Activities should not override this method. Instead, like
save()do any copy work that needs to be done inwrite_file().
- get_active()[source]
Get whether the activity is active. An activity may be made inactive by the shell as a result of another activity being active. An active activity accumulates usage metrics.
- Returns:
if the activity is active.
- Return type:
boolean
- get_activity_root()[source]
Deprecated. This part of the API has been moved out of this class to the module itself
- get_id()[source]
Get the activity id, a likely-unique identifier for the instance of an activity, randomly assigned when a new instance is started, or read from the journal object metadata when a saved instance is resumed.
- Returns:
the activity id
- Return type:
See also
create_activity_id()andunique_id().
- get_max_participants()[source]
Get the maximum number of users that can share a instance of this activity. Should be configured in the activity.info file. When not configured, it will be zero.
- Returns:
the maximum number of participants
- Return type:
See also
get_max_participants()inActivityBundle.
- get_metadata()[source]
Get the journal object metadata.
- Returns:
the journal object metadata, or None if there is no object.
- Return type:
Activities can set metadata in write_file() using:
self.metadata['MyKey'] = 'Something'
and retrieve metadata in read_file() using:
self.metadata.get('MyKey', 'aDefaultValue')
Make sure your activity works properly if one or more of the metadata items is missing. Never assume they will all be present.
- get_preview()[source]
Get a preview image from the
canvas, for use as metadata for the journal object. This should be what the user is seeing at the time.- Returns:
image data in PNG format
- Return type:
Activities may override this method, and return a string with image data in PNG format with a width and height of
PREVIEW_SIZEpixels.The method creates a Cairo surface for the canvas widget, draws on it, then resizes to a surface with the preview size.
Get whether the activity is shared.
- Returns:
the activity is shared.
- Return type:
Get the shared activity of type
sugar4.presence.activity.Activity, or None if the activity is not shared, or is shared and not yet joined.- Returns:
- instance of
the shared activity or None
- Return type:
- handle_view_source()[source]
An activity may override this method to show additional information in the View Source window. Examples can be seen in Browse and TurtleArt.
- Raises:
- invite(account_path, contact_id)[source]
Invite a buddy to join this activity.
- Parameters:
account_path – account path
contact_id – contact ID
- Side Effects:
Calls
share()to privately share the activity if it wasn’t shared before.
- property metadata
Get the journal object metadata.
- Returns:
the journal object metadata, or None if there is no object.
- Return type:
Activities can set metadata in write_file() using:
self.metadata['MyKey'] = 'Something'
and retrieve metadata in read_file() using:
self.metadata.get('MyKey', 'aDefaultValue')
Make sure your activity works properly if one or more of the metadata items is missing. Never assume they will all be present.
- notify_user(summary, body)[source]
Display a notification with the given summary and body. The notification will go under the activities icon in the frame.
Note: In GTK4/Flatpak, this uses the portal notification system.
- read_file(file_path)[source]
Subclasses implement this method if they support resuming objects from the journal. ‘file_path’ is the file to read from.
You should immediately open the file from the file_path, because the file_name will be deleted immediately after returning from
read_file().Once the file has been opened, you do not have to read it immediately: After you have opened it, the file will only be really gone when you close it.
Although not required, this is also a good time to read all meta-data: the file itself cannot be changed externally, but the title, description and other metadata[‘tags’] may change. So if it is important for you to notice changes, this is the time to record the originals.
- Parameters:
file_path (str) – the file path to read
- run_main_loop()[source]
Run the main loop for the activity.
Note: In modern applications, this is typically handled by the application framework, but we keep this for compatibility with legacy code.
- save()[source]
Save to the journal.
This may be called by the
close()method.Activities should not override this method. This method is part of the public API of an activity, and should behave in standard ways. Use your own implementation of write_file() to save your activity specific data.
- set_active(active)[source]
Set whether the activity is active. An activity may declare itself active or inactive, as can the shell. An active activity accumulates usage metrics.
- Parameters:
active (boolean) – if the activity is active.
- set_canvas(canvas)[source]
Set the
canvas.- Parameters:
canvas (
Gtk.Widget) – the widget used as canvas
- set_max_participants(participants)[source]
Set the maximum number of users that can share a instance of this activity. An activity may use this method instead of or as well as configuring the activity.info file. When both are used, this method takes precedence over the activity.info file.
- Parameters:
participants (int) – the maximum number of participants
Request that the activity be shared on the network.
- Parameters:
private (bool) – True to share by invitation only, False to advertise as shared to everyone.
Once the activity is shared, its privacy can be changed by setting the
privateproperty of thesugar4.presence.activity.Activityclass.
- show()[source]
Show the activity window.
In GTK4, ApplicationWindow uses present() instead of show(). This method provides compatibility with the activityinstance API.
- unbusy()[source]
Show that the activity is not busy. An equal number of calls to
unbusy()are required to balance the calls tobusy().
- write_file(file_path)[source]
Subclasses implement this method if they support saving data to objects in the journal. ‘file_path’ is the file to write to.
If the user did make changes, you should create the file_path and save all document data to it.
Additionally, you should also write any metadata needed to resume your activity. For example, the Read activity saves the current page and zoom level, so it can display the page.
Note: Currently, the file_path WILL be different from the one you received in
read_file(). Even if you kept the file_path fromread_file()open until now, you must still write the entire file to this file_path.- Parameters:
file_path (str) – complete path of the file to write
- class sugar4.SimpleActivity(*args: Any, **kwargs: Any)[source]
Bases:
ActivityA simple activity implementation for quick prototyping.
This provides a basic activity with a toolbar and content area.
- class sugar4.XoColor(color_string=None)[source]
Bases:
objectDefines color for XO
This class represents a pair of colors (stroke and fill) that can be used throughout Sugar activities. Colors can be parsed from strings, loaded from user settings, or chosen randomly.
- Parameters:
color_string (str, optional) – Color specification in one of these formats: - “stroke_hex,fill_hex” (e.g., “#FF0000,#00FF00”) - “white” for white theme - “insensitive” for disabled/grayed theme - None to use user’s color from settings or random if not available
Examples
>>> #from string >>> color = XoColor("#FF0000,#00FF00") >>> print(color.get_stroke_color()) # "#FF0000" >>> print(color.get_fill_color()) # "#00FF00"
>>> # create user's color (or random if not set) >>> color = XoColor()
>>> # themed colors >>> white_color = XoColor("white") >>> disabled_color = XoColor("insensitive")
- classmethod from_string(color_string)[source]
Create XoColor from string representation.
- Parameters:
color_string (str) – Color string to parse
- Returns:
New XoColor instance
- Return type:
- Raises:
ValueError – If color_string cannot be parsed
- classmethod get_random_color()[source]
Get a random XO color.
- Returns:
Random XoColor instance from the standard palette
- Return type:
- class sugar4.Icon(*args: Any, **kwargs: Any)[source]
Bases:
WidgetBasic Sugar icon widget.
Displays themed icons with Sugar’s color customization features. Uses modern snapshot-based rendering for improved performance.
- Properties:
icon_name (str): Icon name from theme file_name (str): Path to icon file pixel_size (int): Size in pixels fill_color (str): Fill color as hex string stroke_color (str): Stroke color as hex string xo_color (XoColor): Sugar color pair badge_name (str): Badge icon name alpha (float): Icon transparency (0.0-1.0) scale (float): Icon scale factor sensitive (bool): Whether icon appears sensitive
- __init__(icon_name: str | None = None, file_name: str | None = None, pixel_size: int = 48, **kwargs)[source]
- do_measure(orientation: gi.repository.Gtk.Orientation, for_size: int) Tuple[int, int, int, int][source]
Calculate widget size requirements.
- do_snapshot(snapshot: gi.repository.Gtk.Snapshot)[source]
Render icon using snapshot-based drawing.
- class sugar4.EventIcon(*args: Any, **kwargs: Any)[source]
Bases:
IconIcon widget with mouse event handling using gesture controllers.
Provides click, press, and release events through modern gesture handling for better touch and accessibility support.
- Signals:
clicked: Emitted when icon is clicked pressed: Emitted when icon is pressed released: Emitted when icon is released activate: Emitted when icon is activated
- class sugar4.MenuItem(*args: Any, **kwargs: Any)[source]
Bases:
ButtonA Sugar-style menu item with icon and text support.
This replaces the deprecated ImageMenuItem with a Button that can be used in menus and popover menus.
- Parameters:
- __init__(text_label: str | None = None, icon_name: str | None = None, text_maxlen: int = 60, xo_color=None, file_name: str | None = None)[source]
- get_accelerator() str | None[source]
Get the current accelerator string.
- Returns:
Current accelerator or None
- Return type:
- get_text() str[source]
Get the current text of the menu item.
- Returns:
Current text or empty string
- Return type: