Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructured widget initialization order #2942

Merged
merged 17 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove stray _IMPL_NAMEs and put _create after priming attributes
  • Loading branch information
HalfWhitt committed Nov 15, 2024
commit 030b719bd9bd5f3760c2b6f1753c1327bee0cc5c
8 changes: 3 additions & 5 deletions core/src/toga/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@


class Widget(Node):
_IMPL_NAME = "Widget"

_MIN_WIDTH = 100
_MIN_HEIGHT = 100

Expand All @@ -39,13 +37,13 @@ def __init__(
applicator=None,
HalfWhitt marked this conversation as resolved.
Show resolved Hide resolved
)

# Create and assign _impl
self._create()

self._id = str(id if id else identifier(self))
self._window: Window | None = None
self._app: App | None = None

# Create and assign _impl
self._create()

self.applicator = TogaApplicator()

##############################################
Expand Down
2 changes: 0 additions & 2 deletions core/src/toga/widgets/dateinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def __call__(self, widget: DateInput, /, **kwargs: Any) -> object:


class DateInput(Widget):
_IMPL_NAME = "DateInput"

_MIN_WIDTH = 200

def __init__(
Expand Down
2 changes: 0 additions & 2 deletions core/src/toga/widgets/mapview.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@


class MapPin:
_IMPL_NAME = "MapPin"

def __init__(
self,
location: toga.LatLng | tuple[float, float],
Expand Down
Loading