
    h+%                     f    S SK JrJrJrJrJr  SSKJr  SSKJ	r	  SSKJ
r
  SSKJr   " S S\5      rg	)
    )UnionTupleListOptionalAny   )	CTkCanvas)ThemeManager)
DrawEngine)CTkBaseClassc                     ^  \ rS rSrSr         SS\S\S\S\\\\	4      S\\\\	4      S	\\	\
\	\	4   4   S
\\\	\
\	\	4   4      S\\\	\
\	\	4   4      S\\
\\	\
\	\	4   4      S4   S\\	S4   4U 4S jjjrS\\   4U 4S jjrU 4S jrSU 4S jjrSU 4S jjrSU 4S jjrS\	S\4U 4S jjrSS jrSS jrSrU =r$ )CTkFrame	   z
Frame with rounded corners and border.
Default foreground colors are set according to theme.
To make the frame transparent set fg_color=None.
For detailed information check out the documentation.
Nmasterwidthheightcorner_radiusborder_widthbg_colorfg_colorborder_colorbackground_corner_colors"overwrite_preferred_drawing_methodc                   > [         TU ]  " SXX#S.UD6  Uc  [        R                  S   S   OU R	                  U5      U l        Uc  [        U R                  [        5      (       af  U R                  R                  [        R                  S   S   :X  a  [        R                  S   S   U l	        OM[        R                  S   S   U l	        O1[        R                  S   S   U l	        OU R	                  USS9U l	        Xl
        Uc  [        R                  S   S   OUU l        Uc  [        R                  S   S	   OUU l        [        U S
U R                  U R                  5      U R                  U R                   5      S9U l        U R"                  R%                  S
S
SSS9  U R"                  R'                  U R)                  U R*                  5      S9  [-        U R"                  5      U l        Xl        U R3                  SS9  g )N)r   r   r   r   r   r   r   top_fg_colorTtransparencyr   r   r   )r   highlightthicknessr   r   r   )xyrelwidth	relheightbg)no_color_updates )super__init__r
   theme_check_color_type_border_color
isinstancer   r   	_fg_color_background_corner_colors_corner_radius_border_widthr	   _apply_widget_scaling_current_width_current_height_canvasplace	configure_apply_appearance_mode	_bg_colorr   _draw_engine#_overwrite_preferred_drawing_method_draw)selfr   r   r   r   r   r   r   r   r   r   kwargs	__class__s               a/var/www/fran/franai/venv/lib/python3.13/site-packages/customtkinter/windows/widgets/ctk_frame.pyr(   CTkFrame.__init__   s     	``Y_` P\Oc\//
;NKimii  AM  jN $++x00;;((L,>,>z,J:,VV%1%7%7
%CN%SDN%1%7%7
%CJ%ODN!-!3!3J!?
!K!33H43PDN)A& R_Qfl00<_MlyO[Oc\//
;NKiu 45'+'A'A$BUBU'V(,(B(B4CWCW(XZ 	Q!a1=$"="=dnn"MN&t||43U0

D
)    returnc                    > [         TU ]  5       n UR                  U R                  5        U$ ! [         a    Us $ f = f)zq
winfo_children of CTkFrame without self.canvas widget,
because it's not a child but part of the CTkFrame itself
)r'   winfo_childrenremover4   
ValueError)r<   child_widgetsr>   s     r?   rD   CTkFrame.winfo_childrenC   sD     .0	!  .   	!  	!s   . ==c                    > [         TU ]  " U0 UD6  U R                  R                  U R	                  U R
                  5      U R	                  U R                  5      S9  U R                  5         g N)r   r   )r'   _set_scalingr4   r6   r1   _desired_width_desired_heightr;   )r<   argsr=   r>   s      r?   rK   CTkFrame._set_scalingP   s]    d-f-T%?%?@S@S%T&*&@&@AUAU&V 	 	X

rA   c                    > [         TU ]  X5        U R                  R                  U R	                  U R
                  5      U R	                  U R                  5      S9  U R                  5         g rJ   )r'   _set_dimensionsr4   r6   r1   rL   rM   r;   )r<   r   r   r>   s      r?   rQ   CTkFrame._set_dimensionsW   sX    .T%?%?@S@S%T&*&@&@AUAU&V 	 	X

rA   c                   > [         TU ]  U5        U R                  R                  5       (       d  g U R                  Gb'  U R
                  R                  U R                  U R                  5      U R                  U R                  5      5        U R                  R                  SU R                  U R                  S   5      S9  U R                  R                  SU R                  U R                  S   5      S9  U R                  R                  SU R                  U R                  S   5      S9  U R                  R                  SU R                  U R                  S	   5      S9  OU R                  R                  S
5        U R
                  R                  U R                  U R                  5      U R                  U R                  5      U R                  U R                  5      U R                  U R                  5      U R                   S9nUSL d  U(       Ga+  U R"                  S:X  aN  U R                  R                  SU R                  U R$                  5      U R                  U R$                  5      S9  OMU R                  R                  SU R                  U R"                  5      U R                  U R"                  5      S9  U R                  R                  SU R                  U R&                  5      U R                  U R&                  5      S9  U R                  R)                  U R                  U R$                  5      S9  g g )Nbackground_corner_top_leftr   )fillbackground_corner_top_rightr   background_corner_bottom_right   background_corner_bottom_left   background_parts)r   Ftransparentinner_parts)rU   outlineborder_partsr#   )r'   r;   r4   winfo_existsr.   r9   draw_background_cornersr1   r2   r3   
itemconfigr7   deletedraw_rounded_rect_with_borderr/   r0   r:   r-   r8   r+   r6   )r<   r%   requires_recoloringr>   s      r?   r;   CTkFrame._draw^   s'   &'||((**))555d6P6PQUQdQd6e6:6P6PQUQeQe6fhLL##$@tGbGbcg  dB  dB  CD  dE  HF#  GLL##$AHcHcdh  eC  eC  DE  eF  IG#  HLL##$D4KfKfgk  hF  hF  GH  hI  LJ#  KLL##$C$JeJefj  gE  gE  FG  gH  KI#  JLL 23"//MMdNhNhimi|i|N}NRNhNhimi}i}N~NRNhNhimi|i|N}NRNhNhimi{i{N|qu  rZ  rZ	 N [ u$(;~~.''-1-H-H-X040K0KDNN0[ ( ] ''-1-H-H-X040K0KDNN0[ ( ] LL##N)-)D)DTEWEW)X,0,G,GHZHZ,[ $ ] LL""d&A&A$..&Q"R )<rA   c                   > SU;   am  U R                  UR                  S5      SS9U l        SnU R                  5        H3  n[	        U[
        5      (       d  M  UR                  U R                  S9  M5     SU;   aW  U R                  S:X  aG  U R                  5        H3  n[	        U[
        5      (       d  M  UR                  U R                  S9  M5     SU;   a'  U R                  UR                  S5      5      U l        SnSU;   a  UR                  S5      U l        SnS	U;   a  UR                  S	5      U l	        SnS
U;   a  UR                  S
5      U l
        Sn[        TU ]  " SSU0UD6  g )Nr   Tr   )r   r   r\   r   r   r   r   require_redrawr&   )r*   popr-   rD   r,   r   r6   r+   r.   r/   r0   r'   )r<   rh   r=   childr>   s       r?   r6   CTkFrame.configure   sH   !33FJJz4JY]3^DN!N ,,.e\22OOT^^O< / ~~.!002E!%66@ 3 V#!%!7!7

>8R!SD!N%/-3ZZ8R-SD*!Nf$"(**_"=D!NV#!'N!;D!NBB6BrA   attribute_namec                    > US:X  a  U R                   $ US:X  a  U R                  $ US:X  a  U R                  $ US:X  a  U R                  $ US:X  a  U R                  $ [
        TU ]  U5      $ )Nr   r   r   r   r   )r/   r0   r-   r+   r.   r'   cget)r<   rl   r>   s     r?   rn   CTkFrame.cget   sw    _,&&&~-%%%z)>>!~-%%%99111 7<//rA   c                 d    US:X  d  USL d  [        S5      eU R                  R                  XSS9  g)called on the tkinter.Canvas +TzE'add' argument can only be '+' or True to preserve internal callbacks)addN)rF   r4   bind)r<   sequencecommandrs   s       r?   rt   CTkFrame.bind   s2    s
cTkdee(6rA   c                 X    Ub  [        S5      eU R                  R                  US5        g)rq   Nz'funcid' argument can only be None, because there is a bug in tkinter and its not clear whether the internal callbacks will be unbinded or not)rF   r4   unbind)r<   ru   funcids      r?   ry   CTkFrame.unbind   s1     q r rHd+rA   )r.   r+   r0   r4   r/   r9   r-   r:   )	   r|   NNr\   NNNN)NN)F)NNT)__name__
__module____qualname____firstlineno____doc__r   intr   r   strr   r(   r   anyrD   rK   rQ   r;   r6   rn   rt   ry   __static_attributes____classcell__)r>   s   @r?   r   r   	   s_    ""<@;?9FCGGK]aHL0*0*0* 0* !)sCx 9	0*
  (c3h80* !eCHo!560* $E#uS#X*>$?@0*  (c5c?.B(CD0* ,1uS%S/=Q7R1SUY1Y+Z0* 6;395E0* 0*d!S	 !#SP!CF03 03 0 7, ,rA   r   N)typingr   r   r   r   r   core_renderingr	   r)   r
   r   core_widget_classesr   r   r&   rA   r?   <module>r      s%    4 4 %  & -{,| {,rA   