Skip to content

Commit

Permalink
Make _result_widget a ValueWidget
Browse files Browse the repository at this point in the history
With the work done by @tlambert03, we can now remove the ignores for
mypy
  • Loading branch information
gselzer committed Jan 25, 2022
1 parent 8c7efef commit b5b13a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magicgui/widgets/_function_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from magicgui.events import Signal
from magicgui.signature import MagicSignature, magic_signature
from magicgui.widgets import Container, MainWindow, ProgressBar, PushButton
from magicgui.widgets._bases.widget import Widget
from magicgui.widgets._bases.value_widget import ValueWidget
from magicgui.widgets._protocols import ContainerProtocol, MainWindowProtocol

if TYPE_CHECKING:
Expand Down Expand Up @@ -203,7 +203,7 @@ def _disable_button_and_call():

self.append(self._call_button)

self._result_widget: Widget | None = None
self._result_widget: ValueWidget | None = None
if result_widget:
from magicgui.widgets._bases import create_widget

Expand Down Expand Up @@ -311,8 +311,8 @@ def __call__(self, *args: Any, update_widget: bool = False, **kwargs: Any) -> _R

self._call_count += 1
if self._result_widget is not None:
with self._result_widget.changed.blocked(): # type: ignore
self._result_widget.value = value # type: ignore
with self._result_widget.changed.blocked():
self._result_widget.value = value

return_type = sig.return_annotation
if return_type:
Expand Down

0 comments on commit b5b13a6

Please sign in to comment.