--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I will try to come up with some code this weekend.
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/2lbadbUQxDk/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelHeader
from kivy.uix.button import Button
class TabPanel(TabbedPanel):
def add_header(self):
x = BoxLayout()
x.add_widget(Button(text = 'left'))
z = CloseableHeader(panel = self, content = x)
self.add_widget(z)
uidNewTab = self.tab_list[0].uid
self.tab_list[0].text = str(uidNewTab)
self.tab_list[0].content.add_widget(Button(text = 'right'))
print self.tab_list
print '###########'
class CloseableHeader(TabbedPanelHeader):
pass
class TestTabApp(App):
def build(self):
root = self.root
tab = TabPanel()
root.add_widget(tab)
tab.do_default_tab = False
if __name__ == '__main__':
TestTabApp().run()
#:kivy 1.0
#:import kivy kivy
#:import win kivy.core.window
BoxLayout:
<CloseableHeader>
color: 0,1,0,1
size_hint_x: None
width: self.texture_size[0] + 20
BoxLayout:
pos: root.pos
size: root.size
padding: 10
BoxLayout:
size_hint: None, 1
orientation: 'vertical'
width: 22
Image:
source: 'tools/theming/defaulttheme/close.png'
on_touch_down:
if self.collide_point(*args[1].pos) : root.panel.remove_widget(root)
if self.collide_point(*args[1].pos) : root.OldTabList = root.panel.tab_list
<TabPanel>
FloatLayout:
BoxLayout:
id: tab_1_content
pos:self.parent.pos
size: self.parent.size
BubbleButton:
text: 'Press to add new tab'
on_release: root.add_header()
CloseableHeader:
id: tab1
text: str(self.uid)
content: tab_1_content
panel: root
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
class Field(BoxLayout):
def add_header(self):
x = MyButton()
self.add_widget(x)
class MyButton(Button):
def delete(self):
self.parent.remove_widget(self)
class abcApp(App):
def build(self):
root = self.root
f = Field()
root.add_widget(f)
if __name__ == '__main__':
abcApp().run()
#:kivy 1.0
#:import kivy kivy
#:import win kivy.core.window
BoxLayout:
<MyButton>
on_press: self.delete()
<Field>
BoxLayout:import gc
def one():
userInput = input('Give me a value')#1
y = {}
for a in range (1000000):
y[a] = userInput
userInput = input('Give me a value')#2
del y
def two():
userInput = input('Give me a value')#3
gc.collect()
userInput = input('Give me a value')#4
one()
two()
Peer
When I start your code with a double click on main.py (on Windows 7/ I didn't try Ubuntu yet), the programm
also starts around ~40mb, but then never stops growing. So after 1 hour of running, the size increases up to 170 mb.
As my programm is of course a lot larger then your code, I easily reach 500mb+.