fixing warnings and deprecated calls #46
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements.txt for Ubuntu 25.10.
mesa-utils for "import gi"
fixing warnings and deprecated calls:
test.py:24: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
test.py:47: DeprecationWarning: Gtk.ScrolledWindow.add_with_viewport is deprecated
sw.add_with_viewport(canvas)
Primary Change: Version Specification
Gtkdirectly without specifying which version to use. This triggered a warning because the binding is not future-proof.gi.require_version('Gtk', '3.0')before the import. This ensures the correct API version is loaded and eliminates the warning.Structural & Maintenance Improvements
MatplotlibGTKWindowclass. This is a better practice for organization, reusability, and managing the state of the application.UI/UX Refinements
add_with_viewportmethod to add the widget to theGtk.ScrolledWindow.addmethod forGtk.ScrolledWindow.Gtk.PolicyType.AUTOMATIC, making the scrollbars appear only when needed.In summary, the update focuses on correctness (fixing warnings and deprecated calls), modern structure (using a class), and improved user experience (better plot and scrollbar behavior).