SHARE
TWEET

Untitled

a guest Jun 19th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class CAP(BoxLayout):
  2.  
  3.      def sPop(self):
  4.           box = BoxLayout(background_color=(0, 255, 0, 0.8))
  5.  
  6.          closer = Button(
  7.              text="Close",
  8.              pos_hint={'x': 6, 'center_y': 0.04},
  9.              size_hint=(0.1, 0.1),
  10.              background_color=(0, 0, 255, 0.7)
  11.          )
  12.          box.add_widget(closer)
  13.  
  14.          box.add_widget(Label(text="", index=6))
  15.  
  16.          p = Popup(title = "", content = box, size=(25,  
  17.      25))
  18.          p.background_color=(0, 0, 255, 0.9)
  19.  
  20.          closer.bind(on_press=p.dismiss)
  21.          p.open()
  22.      
  23. from kivy.graphics.context_instructions import Color
  24. from kivy.graphics.vertex_instructions import Rectangle
  25.  
  26. def update_rect(instance, value):
  27.     instance.rect.pos = instance.pos
  28.     instance.rect.size = instance.size
  29.  
  30. with p.canvas.before:
  31.     Color(0, 0.517, 0.705, 1)
  32.     p.rect = Rectangle(size=content.size, pos=content.pos)
  33.     p.bind(pos=update_rect, size=update_rect)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top