Skip to content

Instantly share code, notes, and snippets.

View amalgamatedclyde's full-sized avatar

Clyde Tressler amalgamatedclyde

View GitHub Profile
@amalgamatedclyde
amalgamatedclyde / gist:6715793
Created September 26, 2013 15:27
on_selection_change binding
here is the button that does the job i want on_selection_change to do:
in kv
Button:
id: mybutton_id
detailBox: detailBox
size_hint: (None, .1)
text: 'press'
@amalgamatedclyde
amalgamatedclyde / gist:6735050
Created September 27, 2013 20:57
why doesn't my callback update my listview?
the function MedicalLst() works If i use it to build student_list.
furthermore, the callback prints the correct list to the terminal.
the question is why won't the callback update the listview?
here is the binding: btn1.bind(on_release= (callback2))
here is the callback:
@amalgamatedclyde
amalgamatedclyde / gist:6745337
Created September 28, 2013 19:07
here is my callback
def callback2(instance):
global student_details
try:
if instance.state == 'down':
student_list.adapter.data = MedicalList()
elif instance.state == 'normal':
student_list.adapter.data = StudentList()
student_list.adapter.cached_views = []
student_list.populate()
@amalgamatedclyde
amalgamatedclyde / gist:6780860
Created October 1, 2013 16:03
no child widget showing up
#:kivy 1.0
#:import BoxLayout kivy.uix.boxlayout
#:import ToggleButton kivy.uix.togglebutton
<ButtonPanel@BoxLayout>:
orientation: 'vertical'
id: boxy
ToggleButton:
text: 'is this working?'
@amalgamatedclyde
amalgamatedclyde / gist:6814727
Created October 3, 2013 18:34
here is my dilemma. if i just use two Labels() and the code from the screen manager docs, everything is beautiful. if i comment-out everything but a single label from each of my 2 python files, only the one that is imported first will show.
import kivy
from kivy.uix.label import Label
from kivy.config import Config
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.lang import Builder
import studentListview2
import Layout_master6
kivy.require('1.7.1')
@amalgamatedclyde
amalgamatedclyde / gist:6828209
Created October 4, 2013 15:54
terminal output
clyde@clyde-N55SF:~$ cd buildozer-2
clyde@clyde-N55SF:~/buildozer-2$ ^C
clyde@clyde-N55SF:~/buildozer-2$ buildozer android debug deploy run
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
[app]
# (str) Title of your application
title = SafeTrip DetailView
# (str) Package name
package.name = myapp
# (str) Package domain (needed for android/ios packaging)
package.domain = org.test
here is my SimpleListAdapter that i used to override he default one:
class SimpleListAdapter(SimpleListAdapter):
def __init__(self, **kwargs):
super(SimpleListAdapter, self).__init__(**kwargs)
self.args_converter= lambda row_index, x: {'text': x,
'size_hint_y': None,
'color' : [1,1,0,1],
'text_size': (250, 25),
@amalgamatedclyde
amalgamatedclyde / gist:6902590
Created October 9, 2013 14:53
need to update a listview
here is the adapter:
class studentDetailsAdapter(ListAdapter):
def __init__(self, **kwargs):
super(studentDetailsAdapter, self).__init__(**kwargs)
self.args_converter= lambda row_index, rec: {'text': rec,
'size_hint_y': None,
'text_size': (200, 30),
@amalgamatedclyde
amalgamatedclyde / gist:6933947
Created October 11, 2013 12:40
why doesn't this code update my listadapter?
here is my listadapter using an objectProperty:
class studentDetailsAdapter(ListAdapter):
SDA = ObjectProperty(None)
def __init__(self, **kwargs):
super(studentDetailsAdapter, self).__init__(**kwargs)
self.args_converter = lambda row_index, rec: {'text': rec,
class studentDetailsAdapter(ListAdapter):