Skip to content

Commit f26835f

Browse files
codewizdaveclaude
andcommitted
fix(ui): fix place() method call - remove invalid width parameter
Fix the "width and height arguments must be passed to the constructor" error by using proper place() geometry parameters. The place() method doesn't accept width/height parameters - these must be set in the widget constructor only. Changes: - Remove invalid width parameter from place() call - Use relx=1.0 to position at right edge of parent - Use x=-panel_width to offset left by panel width - Use anchor="nw" (northwest) for proper positioning - Widget width is already set in constructor via super().__init__() The panel now appears correctly at the right edge of the window. Fixes: place() method error when opening forms Related: #14 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent eb94764 commit f26835f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/ui_ctk/components/slide_in_panel.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,15 @@ def show(self):
131131
# Position panel on the right side
132132
# We place it at the right edge with fixed width
133133
parent_width = self.parent.winfo_width()
134-
135-
# Use reqwidth to get the intended width (widget may not be rendered yet)
136134
panel_width = self.cget('width')
137135

138-
# Use place() to position panel at right edge
139-
# relwidth=0 means we use absolute width
136+
# Position panel at right edge (anchor northeast means x,y is the northeast corner)
140137
self.place(
141-
x=parent_width - panel_width,
138+
relx=1.0, # Right edge of parent
139+
x=-panel_width, # Move left by panel width
142140
y=60, # Below navigation bar
143-
width=panel_width, # Explicitly set width
144141
relheight=1.0,
145-
anchor="ne", # North-east anchor
142+
anchor="nw", # Northwest anchor (top-left of panel)
146143
)
147144

148145
# Mark as visible

0 commit comments

Comments
 (0)