Package: ck-widgets
CvaniaK's Widgets for Textual TUI (ck_widgets)This is list of Widgets forTextualframework, created from my personal need.⚠NOTE:This project widgets names, arguments, etc. can vary along diffrent versions.InstallThis is pip package so you can install it using command below:pip3installck-widgets# orpython3-mpipinstallck-widgetsValueBarExamplesThe simples example:# Simples value barfromck_widgets.widgetsimportValueBarH,ValueBarVvbar_horizontal=ValueBarH(max_value=50)# orvbar_vertical=ValueBarV(max_value=50)And here is example with almost all arguments:# Example with almost all argumentsfromck_widgets.widgetsimportValueBarH,CColor,CustomColorfromrichimportboxbackground_color:List[CColor]=["rgb(0,0,0)","rgb(0,0,0)","yellow"]ValueBarH(name="name_to_catch_in_event",label="Almost all arguments",label_align="left",label_position="bottom",start_value=25,max_value=50,height=6,instant=True,reversed=True,color=CustomColor.gradient("green","rgb(0, 100, 250)"),bg_color=background_color,border_style="yellow",padding=(1,1),box=box.DOUBLE_EDGE,)And this example:you can check code in this fileck_widgets/exmples/value_bar.pyor test it by using command below:python3-mck_widgets.examples.value_barKnown LimitationsYou need to force size of layout to be not smaller than maximum size of of ValueBar (otherwise it will behave badly)...TODOReactive version (so it gives values from 0 to 1 and can be resized/'squashed')Be sure that provide all argumentsTest edge casesClean up how to provide colorLabel on left or right site...ListViewUoWhile waiting forticket(also mentionedhere) and officialListView, you can use this dirty version that allows you to scroll thrue list of widgets.ExamplesYou can use it this way:fromck_widgets_lvimportListViewUoclassTestListView(App):asyncdefon_mount(self,event:events.Mount)->None:awaitself.view.dock(ListViewUo([Placeholder(height=10)for_inrange(20)]))if__name__=="__main__":TestListView.run()or more complex example (from gif demo above):fromtextual.widgetsimportPlaceholderfromtextual.widgetimportWidgetfromtextual.eventsimportMessagefromtextual.appimportAppfromtextualimporteventsfromck_widgets.widgetsimportListViewUoif__name__=="__main__":fromtextual.widgetsimportFooterclassDeleteStatus(Message):def__init__(self,sender:Widget):super().__init__(sender)self.to_delete=senderclassDeletablePlaceholder(Placeholder):asyncdefon_click(self,event:events.Click)->None:awaitself.emit(DeleteStatus(self))classTestListView(App):asyncdefaction_add(self)->None:awaitself.list_view.add_widget(DeletablePlaceholder(height=10))self.refresh()asyncdefaction_add_index_2(self)->None:awaitself.list_view.add_widget(DeletablePlaceholder(height=10),index=2)self.refresh()asyncdefaction_remove(self)->None:awaitself.list_view.remove_widget_by_index()self.refresh()asyncdefaction_remove_index_2(self)->None:awaitself.list_view.remove_widget_by_index(index=2)self.refresh()asyncdefon_load(self,_:events.Load)->None:awaitself.bind("a","add()","Add Widget")awaitself.bind("s","add_index_2()","Add Widget in index 2")awaitself.bind("r","remove()","Remove Widget")awaitself.bind("e","remove_index_2()","Remove Widget in index 2")awaitself.bind("Click Widget","_()","To delete it")asyncdefon_mount(self,event:events.Mount)->None:self.list_view=ListViewUo([DeletablePlaceholder(height=10)for_inrange(7)])awaitself.view.dock(Footer(),edge="bottom")awaitself.view.dock(self.list_view)asyncdefhandle_delete_status(self,message:DeleteStatus):awaitself.list_view.remove_widget(message.to_delete)TestListView.run()Change Log[0.2.0] - 2022-04-11AddedListViewUo from previousrepo[0.1.0] - 2022-02-26AddedValueBarTest version of DebugWidget