Remember that you can only post with the address you subscribed with.
In answer to your question, can you do something like:
def button_press(clist, event):
if event.button == 3: # check for right mouse button
res = clist.get_selection_info(event.x, event.y)
if not res: return # click was in border or titles
row, col = res
clist.select_row(row, col)
clist.connect('button_press_event', button_press)
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
---------- Forwarded message ----------
Date: Sun, 31 Oct 1999 17:36:48 +0800 (WST)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: BOUNCE [EMAIL PROTECTED]: Non-member submission from [David Bustos
<[EMAIL PROTECTED]>]
>From [EMAIL PROTECTED] Sun Oct 31 17:36:45 1999
Received: from chamber.cco.caltech.edu (chamber.cco.caltech.edu [131.215.48.55])
by quoll.daa.com.au (8.9.2/8.9.2) with ESMTP id RAA02545
for <[EMAIL PROTECTED]>; Sun, 31 Oct 1999 17:36:42 +0800 (WST)
Received: from alex.caltech.edu (ruddock-57.caltech.edu [131.215.90.57])
by chamber.cco.caltech.edu (8.9.3/8.9.3) with ESMTP id BAA09856
for <[EMAIL PROTECTED]>; Sun, 31 Oct 1999 01:23:09 -0800 (PST)
Received: from david by alex.caltech.edu with local (Exim 3.03 #1 (Debian))
for [EMAIL PROTECTED]
id 11hrD7-00015n-00; Sun, 31 Oct 1999 01:23:37 -0800
Date: Sun, 31 Oct 1999 01:23:37 -0800
From: David Bustos <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Manipulating the focus_row of a CList
Message-ID: <[EMAIL PROTECTED]>
Reply-To: David Bustos <[EMAIL PROTECTED]>
Mail-Followup-To: [EMAIL PROTECTED]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
User-Agent: Mutt/1.0pre4i
Hello. I want to make a clist respond to a right click the same way it
responds to a left click. I've connected a function that handles a right
click event by selecting the apropriate row (as below), but the focused row
doesn't change. Without methods in GtkCList to change it, the only other
way I can think to do it is by changing the button attribute of the
GdkEvent object and emitting a new signal, but IIRC, GdkEvent objects are
read-only and cannot be created from Python. What's the solution?
Thanks,
David Bustos
---------------------------------------------------------------------------
from gtk import *
def enable_right_select(clist, event):
try: row, col = clist.get_selection_info(event.x, event.y)
except: return
if event.button == 3:
clist.select_row(row, col)
win = GtkWindow()
win.set_usize(100, 200)
win.connect('destroy', mainquit)
clist = GtkCList(1, ('Things',))
for i in range(9): clist.append(('Stuff %i' % i,))
clist.connect('button_press_event', enable_right_select)
win.add(clist)
win.show_all()
mainloop()
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]