Add constraints to ScrollView and update logs

This commit is contained in:
2026-01-21 09:46:47 -05:00
parent 6a6fc81f2b
commit 818cf50ca3

View File

@@ -72,6 +72,11 @@ class ItemSenseApp(NSObject):
self.scroll_view.setDocumentView_(self.text_view)
self.stack_view.addView_inGravity_(self.scroll_view, 2)
# Constraint: Give the scroll view a minimum height so it doesn't collapse
self.scroll_view.translatesAutoresizingMaskIntoConstraints = False
self.scroll_view.heightAnchor().constraintGreaterThanOrEqualToConstant_(150.0).setActive_(True)
self.scroll_view.widthAnchor().constraintEqualToAnchor_(self.window.contentView().widthAnchor(), constant=-20).setActive_(True)
self.text_view.setString_("Initializing camera...")
# Capture Button
@@ -192,7 +197,7 @@ class ItemSenseApp(NSObject):
self.performSelectorOnMainThread_withObject_waitUntilDone_("handleError:", str(e), False)
def handleResponse_(self, result):
print(f"OpenAI Response received")
print(f"OpenAI Response received: {result}")
self.text_view.setString_(result)
self.capture_button.setTitle_("Scan Another")
self.capture_button.setEnabled_(True)