<div dir="ltr">Well, here are some clues - the &quot;multiple&quot; inheritance doesn&#39;t seem to work the way the manual *implies* it should i.e. multiple inheritance is described as searching for methods in the first inheritance and then all it&#39;s ancestors, then onto the next and all its ancestors and so on.<br>
<br>To get an &quot;insert&quot; (Listbox) method on your class you need to invoke the __init__ method on the super classes (sub-classes should always invoke the initialisation of their super class anyway - so that is something your class definition is definitely missing!) i.e.<br>
<br>&nbsp;&nbsp; Listbox.__init__(self)<br><br>If you do just this, then ScrolledList has the Listbox attributes (and none of the others). If you then add initialisation of Scrollbar then you have this:<br><br>&nbsp;&nbsp;&nbsp; Listbox.__init__(self)<br>
&nbsp;&nbsp;&nbsp; Scrollbar.__init__(self)<br><br>And viola! ScrolledList now has the methods of Scrollbar - and &quot;lost&quot; the methods of Listbox.<br><br>So without being any kind of expert on Tk objects with inheritance etc it looks very much as though you have attempted too simplistic an approach to creating what amounts to a &quot;composite&quot; object.<br>
<br>I would suggest that you pick one of your 3 objects to do the real inheritance - and then create actual methods on ScrolledList that &quot;duplicate&quot; the methods of the other object methods. That is the only way I can see you get this working at the moment.<br>
<br>Hope this helps<br>Peter<br><br><div class="gmail_quote">On Wed, Aug 6, 2008 at 6:23 PM, vtcodger <span dir="ltr">&lt;<a href="mailto:donaldkenney@gmail.com">donaldkenney@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Ron -- Thanks, I thought I was doing about what you describe, but apparently<br>
not as the tk attribute for the class objects is not getting set up. &nbsp;I&#39;m a<br>
bit hazy on what the tk attribute does (other than making things work) and<br>
can&#39;t find much about it via Google. &nbsp;I&#39;ll go back and subclass from frame<br>
rather than trying to multiply inherit from Frame, List, and Scrollbar.<br>
<br>
Peter -- Thanks also. &nbsp;I was aware of the PMW scrolledlist. &nbsp;And it works<br>
fine. &nbsp;But I don&#39;t want to use any components that are not part of the<br>
standard Python distribution. &nbsp;Should have mentioned that, but the post was<br>
getting overlong.<br>
<br>
===<br>
<br>
As a practical matter, I discovered after I posted, that I can access my<br>
frame, list (and probably scrollbar as well) methods from the main program<br>
via their objects. &nbsp;That is to say that the way I did it, a scrolled list<br>
object sl doesn&#39;t have a directly usable grid or insert method, but<br>
sl.f.grid(... or sl.l.insert seem to work fine.<br>
<br>
What bothers me, isn&#39;t that I can&#39;t get things to work. &nbsp;It&#39;s that I clearly<br>
don&#39;t understand what is going on.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Creating-a-new-widget-class-tp18802754p18846448.html" target="_blank">http://www.nabble.com/Creating-a-new-widget-class-tp18802754p18846448.html</a><br>
</font><div><div></div><div class="Wj3C7c">Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Tkinter-discuss mailing list<br>
<a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tkinter-discuss" target="_blank">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>
</div></div></blockquote></div><br></div>