Package: hPyT
hPyT - Hack Python TitlebarA package to manipulate windows and titlebar of GUI applications made using pythonSupports Both Windows 11 and 10https://github.com/Zingzy/hPyT/assets/90309290/c61b3142-80d6-4c07-b8e3-65694faf945bYou can download the above app from thegithub releasesto test out the package before installing/using it in your projects📖 Table of ContentshPyT - Hack Python Titlebar📚 Supported Libraries📦 Installing📥 ImportingHide/Unhide Title Bar🌈 Rainbow TitleBarHide/Unhide both Maximize and Minimize Buttons (Completely Hides both buttons)Hide/Unhide All Buttons or StuffsEnable/Disable Maximize ButtonEnable/Disable Minimize ButtonOpacity⚡ Flashing Window🎨 Custom TitleBar Color🖌️ Custom TitleBar Text Color💻 Window ManagementCenter a window on the screenCenter a secondary window relative to the primary windowOther basic window management functions✨ Window AnimationsCircle MotionVerical ShakeHorizontal Shake✏️ Stylize textMiscellaneous📜 hPyT Changelogv1.2.1v1.2.0v1.1.3v1.1.2v1.1.1v1.1.0📚 Supported LibrariesTkinter & CustomTkinterPyQtPySideWxPythonsupport for more libraries soon...📦 InstallingpipinstallhPyT==1.2.1📥 ImportingfromhPyTimport*fromcustomtkinterimport*# you can use any other library from the above mentioned listwindow=CTk()# creating a window using CustomTkinterHide/Unhide Title Bartitle_bar.hide(window)# hides full titlebar# title_bar.unhide(window)🌈 Rainbow TitleBarrainbow_title_bar.start(window,interval=5)# starts the rainbow titlebar# rainbow_title_bar.stop(window) # stops the rainbow titlebarintervalis the time in milliseconds in which the color would changeHide/Unhide both Maximize and Minimize Buttons (Completely Hides both buttons)maximize_minimize_button.hide(window)# hides both maximize and minimize button# maximize_minimize_button.unhide(window)Hide/Unhide All Buttons or Stuffsall_stuffs.hide(window)# hides close button# all_stuffs.unhide(window)Tip:to hide the text set the window title to ''Enable/Disable Maximize Buttonmaximize_button.disable(window)# hides maximize button# MaximizeButton.enable(window)Enable/Disable Minimize Buttonminimize_button.disable(window)# hides minimize button# MinimizeButton.enable(window)Opacityopacity.set(window,0.5)# sets the window opacity to 50%# opacity.set(window, 1) # resets the window opacity to 100%⚡ Flashing Windowwindow_flash.flash(window,10,100)# flashes the window 10 times with 100ms interval# window_flash.stop(window) # stops the flashing immediatelyFlashing Interval starts from 10ms,default 1000ms🎨 Custom TitleBar Colortitle_bar_color.set(window,'#ff00ff')# sets the titlebar color to magentaYou can pass any valid color inHexorRGBformat🖌️ Custom TitleBar Text Colortitle_text_color.set(window,'#ff00ff')# sets the titlebar text color to magentaYou can pass any valid color inHexorRGBformat💻 Window ManagementCenter a window on the screenwindow_frame.center(window)Center a secondary window relative to the primary windowwindow_frame.center_relative(window,child_window)Example Usecasewindow=CTk()window.title("Primary Window")child_window=CTkToplevel()window_frame.center_relative(window,child_window)window.bind("<Configure>",lambdaevent:window.center_relative(window,child_window))Other basic window management functionswindow_frame.move(window,100,100)# moves the window to (100, 100)window_frame.resize(window,500,500)# resizes the window to 500x500window_frame.maximize(window)# maximizes the windowwindow_frame.minimize(window)# minimizes the windowwindow_frame.restore(window)# restores the window✨ Window AnimationsCircle Motionwindow_animation.circle_motion(window,count=5,interval=5,radius=30)# moves the window in a circular motion 5 times with 5ms interval and 30px radiusThe animation might appear a bit fasterer and rougher in the above preview gif than it isVerical Shakewindow_animation.vertical_shake(window,count=5,interval=5,apmlitude=20)# shakes the window vertically 5 times with 5ms interval and 10px distanceHorizontal Shakewindow_animation.horizontal_shake(window,count=5,interval=5,apmlitude=20)# shakes the window horizontally 5 times with 5ms interval and 10px distance✏️ Stylize texttitle_text.stylize(window,style=1)Below is a gif demonstrating all of the available stylesMiscellaneousprint(stylize_text("Your Custom Text",style=1))# stylizes your text# all of the styles shown on the above gif are available>>>"𝔜𝔬𝔲𝔯 ℭ𝔲𝔰𝔱𝔬𝔪 𝔗𝔢𝔵𝔱"📜 hPyT Changelogv1.2.1Minor Bug Fixesv1.2.0Add support for rainbow titlebarAdd support for styling title textAdd support for vertical, horizontal shake and circle motion window animationsAdd support for centering a window on the screenAdd support for centering a window relative to another windowAdd support for moving/resizing/maximizing/minimizing/restoring a windowAdd support for setting custom titlebar colorAdd support for setting custom titlebar text colorv1.1.3Add flashing inverval supportv1.1.2Add window flashing supportAdd window opacity supportAdd support for PyGTKv1.1.1Add support for WxPython, PyQt and PySidev1.1.0Initial Release© zingzy . 2024All Rights Reserved