Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96626
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail |
|---|---|
| Return-Path | <lac@openend.se> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'needed,': 0.05; 'canvas': 0.07; 'cc:addr:python-list': 0.09; '*args):': 0.09; '__init__': 0.09; 'hardcoded': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'url:github': 0.09; 'def': 0.13; '>to': 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'collins': 0.16; 'editable': 0.16; 'false}': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message- id:@fido.openend.se': 0.16; 'paulo': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'silly': 0.16; 'example.': 0.18; 'laura': 0.18; '2015': 0.20; 'cc:addr:python.org': 0.20; 'first,': 0.20; 'fix': 0.21; 'cc:2**1': 0.22; 'color,': 0.22; 'sep': 0.22; 'this:': 0.23; 'import': 0.24; 'all.': 0.24; "doesn't": 0.26; 'example': 0.26; 'subject:list': 0.26; 'skip:_ 20': 0.26; 'not.': 0.27; "skip:' 10": 0.28; 'be:': 0.29; 'behaviour': 0.29; 'for,': 0.29; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; 'solutions.': 0.30; 'class': 0.33; 'url:python': 0.33; 'changing': 0.34; 'definition': 0.34; 'tue,': 0.34; 'this?': 0.34; 'clear': 0.35; 'something': 0.35; 'comment': 0.35; 'expected': 0.35; "isn't": 0.35; 'item': 0.35; 'but': 0.36; 'needed': 0.36; 'url:org': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'method': 0.37; 'charset:us-ascii': 0.37; 'seem': 0.37; 'skip:s 40': 0.38; 'skip:p 20': 0.38; 'why': 0.39; 'sure': 0.39; 'skip:e 20': 0.39; 'your': 0.60; 'header:Message-Id:1': 0.61; 'real': 0.62; 'here.': 0.62; 'better.': 0.66; 'here': 0.66; 'results': 0.66; 'color': 0.67; 'apologize': 0.69; '>how': 0.84; 'header:In-reply-to:1': 0.84 |
| To | Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> |
| cc | python-list@python.org, lac@openend.se |
| From | Laura Creighton <lac@openend.se> |
| Subject | Re: kivy editable multicolumn list |
| In-reply-to | <mt7vuk$fq$1@speranza.aioe.org> |
| References | <mt7vuk$fq$1@speranza.aioe.org> |
| Comments | In-reply-to Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> message dated "Tue, 15 Sep 2015 03:31:49 +0100." |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="us-ascii" |
| Content-ID | <9142.1442313767.1@fido> |
| Date | Tue, 15 Sep 2015 12:42:47 +0200 |
| X-Greylist | Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Tue, 15 Sep 2015 12:42:59 +0200 (CEST) |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.589.1442313796.8327.python-list@python.org> (permalink) |
| Lines | 70 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1442313796 news.xs4all.nl 23759 [2001:888:2000:d::a6]:32937 |
| X-Complaints-To | abuse@xs4all.nl |
| X-Received-Bytes | 5662 |
| X-Received-Body-CRC | 629278355 |
| Xref | csiph.com comp.lang.python:96626 |
Show key headers only | View raw
In a message of Tue, 15 Sep 2015 03:31:49 +0100, Paulo da Silva writes:
>Hi all.
>Not sure if this is the place to ask about kivy ...
>I apologize if not.
>
>I am playing with the example here
>https://gist.github.com/geojeff/4442405
>
>Now I would like to change the background color the editable field.
>
>So I added
> def __init__(self,**kwargs):
> super(EditableLabel,self).__init__(**kwargs)
> with self.canvas.before:
> Color(0,1,0)
> Rectangle(pos=self.pos,size=self.size)
> print(self.pos,self.size)
>
>to class EditableLabel.
>
>But when entering __init__ self.pos and self.size do not have the
>correct pos/size for the EditableLabel.
>
>How can I fix this? Please no kv solutions. I need dynamic change it in
>a real example.
I am not sure what you want for your integers_dict. It isn't the
something that Rob Collins fixtures package provides. :)
https://pypi.python.org/pypi/fixtures
I just hardcoded it like this:
integers_dict = {str(i): {'text': str(i), 'is_selected': False}
for i in range(100)}
which I pasted out of http://kivy.org/docs/api-kivy.uix.listview.html
'Using an Item View Template'. This may have no relation to what you
really want.
you also need a line
from kivy.graphics import Color, Rectangle
Then you change your class definition to be:
class EditableLabel(ListItemLabel):
def __init__(self,**kwargs):
super(EditableLabel, self).__init__(**kwargs)
self.bind(pos=self.redraw)
self.bind(size=self.redraw)
def redraw(self, *args):
self.canvas.clear()
with self.canvas:
Color(.5,.5,.5)
Rectangle(pos=self.pos,size=self.size)
I don't know why changing self.canvas.before: to self.canvas: in the redraw
method was needed here. I expected self.canvas.before to be what was
needed, but doesn't seem that way.
If you don't clear the canvas first, in the redraw the results look very
silly to me. However, since you are just playing around to learn things,
then that behaviour may be what you are looking for, so comment it out
and see if you like that better.
HTH,
Laura
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
kivy editable multicolumn list Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> - 2015-09-15 03:31 +0100
RE: kivy editable multicolumn list David Aldrich <David.Aldrich@EMEA.NEC.COM> - 2015-09-15 07:44 +0000
Re: kivy editable multicolumn list Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> - 2015-09-17 02:02 +0100
Re: kivy editable multicolumn list Laura Creighton <lac@openend.se> - 2015-09-15 12:42 +0200
Re: kivy editable multicolumn list Paulo da Silva <p_s_d_a_s_i_l_v_a_ns@netcabo.pt> - 2015-09-17 02:17 +0100
csiph-web