teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

整合性をとりました。

2018/02/01 02:09

投稿

roshi10011
roshi10011

スコア8

title CHANGED
File without changes
body CHANGED
@@ -123,10 +123,10 @@
123
123
  print(id, per)
124
124
 
125
125
 
126
- class Row(BoxLayout):
126
+ # class Row(BoxLayout):
127
- is_checked = BooleanProperty(False)
127
+ # is_checked = BooleanProperty(False)
128
- id = StringProperty()
128
+ # id = StringProperty()
129
- permission = StringProperty()
129
+ # permission = StringProperty()
130
130
 
131
131
 
132
132
  class GUIApp(App):

1

pyファイルを追加しました。

2018/02/01 02:09

投稿

roshi10011
roshi10011

スコア8

title CHANGED
File without changes
body CHANGED
@@ -69,7 +69,7 @@
69
69
  text: "削除"
70
70
  size: 80, 40
71
71
  size_hint: None, None
72
- # on_press: print(root.rv.data)
72
+ on_press: root.delete(num,a) # 押下時に表中でチェックの入った行を削除したい
73
73
 
74
74
  <Row@BoxLayout>:
75
75
  canvas.before:
@@ -88,6 +88,63 @@
88
88
  CheckBox:
89
89
  ```
90
90
 
91
+ ```python
92
+ from kivy.app import App
93
+ from kivy.config import Config
94
+ from kivy.lang import Builder
95
+ from kivy.uix.screenmanager import ScreenManager, Screen, NoTransition
96
+ from kivy.uix.boxlayout import BoxLayout
97
+ from kivy.properties import StringProperty, ObjectProperty, BooleanProperty
98
+ from kivy.core.text import LabelBase, DEFAULT_FONT
99
+ from kivy.resources import resource_add_path
100
+ Config.set('graphics', 'width', '800')
101
+ Config.set('graphics', 'height', '600')
102
+ Config.set('input', 'mouse', 'mouse,disable_multitouch') # 右クリック赤丸消去
103
+ Config.set('kivy', 'exit_on_escape', '0') # kivy ESC無効化
104
+
105
+ # Path of Fonts
106
+ resource_add_path('/usr/share/fonts/truetype/takao-gothic')
107
+ LabelBase.register(DEFAULT_FONT, 'TakaoGothic.ttf') # 日本語が使用できるように日本語フォントを指定する
108
+
109
+ # Path of KV_Lang
110
+ Builder.load_file("./Account_for_teratail.kv")
111
+
112
+ # Setting Screen
113
+ SM = ScreenManager(transition=NoTransition())
114
+
115
+
116
+ class Manager(Screen):
117
+ rv = ObjectProperty()
118
+
119
+ def on_enter(self):
120
+ self.rv.data = [{'data': ("000000", "manager", "pass")}]
121
+
122
+ def delete(self, id, per):
123
+ print(id, per)
124
+
125
+
126
+ class Row(BoxLayout):
127
+ is_checked = BooleanProperty(False)
128
+ id = StringProperty()
129
+ permission = StringProperty()
130
+
131
+
132
+ class GUIApp(App):
133
+ """
134
+ 実行クラス
135
+ """
136
+ def build(self):
137
+ SM.add_widget(Manager(name="manager"))
138
+ self.title = 'アカウント管理ソフト'
139
+ return SM
140
+
141
+
142
+ if __name__ == '__main__':
143
+ GUIApp().run()
144
+
145
+
146
+ ```
147
+
91
148
  ###備考
92
149
  python: 3.4.2
93
150
  kivy: 1.10.0