473,396 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

KivyMd bottom sheet. ( I would like to know how to display a different screen when I

1
I would like you to help me to complete one of my class projects. I would like to know how to display a different screen when I click on one of the Items. Thanks for helping me. My code is there :



Expand|Select|Wrap|Line Numbers
  1. from kivy.lang import Builder
  2. from kivymd.toast import toast
  3. from kivymd.uix.bottomsheet import MDListBottomSheet
  4. from kivymd.app import MDApp
  5. KV = '''
  6. Screen:
  7.     MDToolbar:
  8.         title: "Example BottomSheet"
  9.         pos_hint: {"top": 1}
  10.         elevation: 10
  11.     MDRaisedButton:
  12.         text: "Open list bottom sheet"
  13.         on_release: app.show_example_list_bottom_sheet()
  14.         pos_hint: {"center_x": .5, "center_y": .5}
  15. '''
  16.  
  17. Items = "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
  18. class Example(MDApp):
  19.     def build(self):
  20.         return Builder.load_string(KV)
  21.     def callback_for_menu_items(self, *args):
  22.         toast(args[0])
  23.     def show_example_list_bottom_sheet(self):
  24.         bottom_sheet_menu = MDListBottomSheet()
  25.         for i in Items:
  26.             bottom_sheet_menu.add_item(
  27.                 f" {i}",
  28.                 lambda x, y=i: self.callback_for_menu_items(
  29.                     f" {y}"
  30.                 ),
  31.             )
  32.         bottom_sheet_menu.open()
  33.  
  34. Example().run()


Thank you very much for helping me.
Jun 3 '20 #1
0 1922

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: charlie_M | last post by:
Is there a way to blank the screen in a FORM's onsubmit=... to blank the screen for the user?? I asked this before and got a way to blank a table by id with ...
2
by: Wayne Aprato | last post by:
How do most Access developers handle the issue of different database users possibly running different screen resolutions? At the moment, I design for the worst case scenario ie. 800 x 600 screen...
5
by: hayworth | last post by:
How do I get the color depth of the screen/display adapter with vb.net 2003? Background: We're having transparency problems (long side story and known Windows "bug") that requires our systems to...
1
by: leovega | last post by:
Hello, My aplication starts with a simple login window (login_page.aspx). Once the login/password is validated I redirect to an html which contains 3 frames. (mywebsite.html) The web site I...
0
by: arunpillai | last post by:
hi guys, My problem is i need to display different html page in content place holder just like how we will be doing in the frames. I have a menu control when ever the menu is clicked the particular...
5
by: libsfan01 | last post by:
function switch_display(switchme) { var el = document.getElementById(switchme); el.style.display = (el.style.display == 'none')? '' : 'none'; } im using this function to switch the display on...
2
by: =?Utf-8?B?Z2FuZQ==?= | last post by:
Hi, In a gridview, How can i display different columns between item and edit modes. For eg. i have a sql that returns productname, categoryname, etc. In viewmode, i need to display only...
1
by: tarabztk | last post by:
MSACCESS 2003 : How to use command buttons to display different subforms I have an application that display information about Pipelines and these pipelines have many other equipments attached to...
0
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi All, I will start working on a form soon which runs as an mdi container (in the main screen) However there is this "new" requirement, there will be 4 screens, and one of the features of the...
3
by: ravideep | last post by:
if I set the website layout in pixels, say 800X600. It works fine with screens with window size 800X600. But if someone is having screen 1200X800, then it doesn't stretch to the full window. How can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.