<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Your script works as expected and&nbsp;I think the problem in my script is a conflict when importing modules. The following are modules loaded order:</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">from Tkinter import *<BR>from copy import copy, deepcopy<BR>import Tix<BR>import tkFileDialog<BR>import Tkinter as Tk<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Is there a way i can resolve the conflict between tkinter and tix without removing tkinter?</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thanks,</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Hani</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: James Brotchie &lt;brotchie@gmail.com&gt;<BR>To: hani abraham &lt;abraham_h101@yahoo.ca&gt;<BR>Cc: Tkinter-discuss@python.org<BR>Sent: Sunday, August 5, 2007 7:16:41 AM<BR>Subject: Re: [Tkinter-discuss] Fwd: Tix hlist-clearing selection<BR><BR>Does this script function as expected on your installation? You should be able to select multiple items in the tree and then clear the selection with the button.<BR><BR>Works for me on both winxp and ubuntu with 2.6trunk, 2.5maint and 2.4maint compiled against tcl8.4.12, tix-8.4.0, tk8.4.12. Which version of python and what tcl/tk/tix libraries are you using?<BR><BR>cat hlisttest.py<BR><BR>from Tix import *<BR><BR>def clearSelection(hlist): <BR>&nbsp;&nbsp;&nbsp; hlist.selection_clear()<BR><BR>tk = Tk()<BR><BR># create and configure tree<BR>tree = Tree(tk)<BR>tree.hlist['selectmode'] =
 EXTENDED<BR>tree.hlist['wideselection'] = TRUE<BR>tree.hlist['background'] = 'white' <BR><BR># add a couple of tree nodes<BR>tree.hlist.add("test1", text="Hello world")<BR>for i in range(5):<BR>&nbsp;&nbsp;&nbsp; tree.hlist.add_child("test1", text="item%d" % i)<BR><BR># add button for selection clear <BR>Button(tk, text="Clear Selection", command=lambda:clearSelection(tree.hlist)).pack()<BR><BR># pack tree<BR>tree.pack(expand=TRUE, fill=BOTH)<BR><BR>tk.mainloop()<BR><BR>
<DIV><SPAN class=gmail_quote>On 8/5/07, <B class=gmail_sendername>hani abraham</B> &lt;<A href="mailto:abraham_h101@yahoo.ca" target=_blank rel=nofollow>abraham_h101@yahoo.ca</A>&gt; wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Yes, i used the hlist component of the tree but nothing happens. The thing is I can clear the selection if I use selection_set then selection_clear but i can't clear the selection when it's highlight with a mouse. </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Thanks, </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Hani<BR></DIV>
<DIV><SPAN class=e id=q_114349871d712ca6_1>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: James Brotchie &lt;<A href="mailto:brotchie@gmail.com" target=_blank rel=nofollow> brotchie@gmail.com</A>&gt;<BR>To: <A href="mailto:Tkinter-discuss@python.org" target=_blank rel=nofollow>Tkinter-discuss@python.org</A><BR>Sent: Sunday, August 5, 2007 12:50:55 AM <BR>Subject: [Tkinter-discuss] Fwd: Tix hlist-clearing selection<BR><BR><SPAN class=gmail_quote></SPAN>Hey Hani,<BR><BR>Are you sure you are calling the selection_clear method of the hlist child widget and not the parent tree? <BR><BR>eg.<BR>tree = Tix.Tree(root)<BR>tree.hlist.selection_clear ()<BR><BR>If you look in Tix.py you can see that Tree is a compound widget containing two scrollbars and a hlist. <BR><BR>class Tree(TixWidget):<BR>&nbsp;&nbsp;&nbsp; def __init__(self, master=None, cnf={}, **kw): <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TixWidget.__init__(self,
 master, 'tixTree',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ['options'], cnf, kw)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.subwidget_list ['hlist'] = _dummyHList(self, 'hlist')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') <BR><BR>Thus to clear the hlist selection you must address the child hlist directly and not its parent Tree widget.<BR><BR>Cheers,<BR>James <BR><BR>
<DIV>
<DIV><SPAN><SPAN class=gmail_quote>On 8/5/07, <B class=gmail_sendername>hani abraham </B>&lt;<A href="mailto:abraham_h101@yahoo.ca" target=_blank rel=nofollow> abraham_h101@yahoo.ca</A>&gt; wrote:</SPAN></SPAN></DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV><SPAN>
<DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>Hi, </DIV>
<DIV>&nbsp;</DIV>
<DIV>I'm&nbsp;new to python and&nbsp;i'm using&nbsp;Tix Tree widget in my application. I'm trying to clear the tree selection but no luck so far. I tried selection_clear and anchor_clear but these aren't working. Can someone help? </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Hani</DIV></DIV><SPAN><BR>
<HR SIZE=1>
Ask a question on any topic and get answers from real people. <A href="http://ca.answers.yahoo.com/" target=_blank rel=nofollow><B>Go to Yahoo! Answers.</B></A> </SPAN></DIV><BR></SPAN></DIV>_______________________________________________<BR>Tkinter-discuss mailing list<BR><A href="mailto:Tkinter-discuss@python.org" target=_blank rel=nofollow>Tkinter-discuss@python.org </A><BR><A href="http://mail.python.org/mailman/listinfo/tkinter-discuss" target=_blank rel=nofollow>http://mail.python.org/mailman/listinfo/tkinter-discuss </A><BR><BR></BLOCKQUOTE></DIV><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></SPAN></DIV></DIV><SPAN class=ad><BR>
<HR SIZE=1>
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the <A href="http://us.rd.yahoo.com/evt=40705/*http://mrd.mail.yahoo.com/try_beta?.intl=ca" target=_blank rel=nofollow><B>All-new Yahoo! Mail </B></A></SPAN></DIV></BLOCKQUOTE></DIV><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>
      <hr size=1>Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the <a href="http://us.rd.yahoo.com/evt=40705/*http://mrd.mail.yahoo.com/try_beta?.intl=ca"><b>All-new Yahoo! Mail </b></a> 
</body></html>