view finch/libgnt/pygnt/test.py @ 18712:c65c4caa817a

When we get a presence of type="error" from the server that corresponds to a Jabber chat, only destroy/free/close/leave the chat room if the error happened while joining (and we were therefore never in the room). This fixes the following bug: 1. Join a room 2. Try to change your nickname to something that's being used by someone else 3. The server gives you an error message, but you're not actually kicked out of the room 4. Pidgin thinks you've been kicked out and won't let you send messages to the room, etc.
author Mark Doliner <mark@kingant.net>
date Sun, 29 Jul 2007 07:01:13 +0000
parents 5e1412f4e67a
children 6b16fca71f8b
line wrap: on
line source

#!/usr/bin/python
import gnt

def button_activate(button, tree):
	list = tree.get_selection_text_list()
	str = ""
	for i in list:
		str = str + i
	entry.set_text("clicked!!!" + str)

gnt.gnt_init()

win = gnt.Window()

entry = gnt.Entry("")

win.add_widget(entry)
win.set_title("Entry")

button = gnt.Button("Click!")
win.add_widget(button)

tree = gnt.Tree()
tree.set_property("columns", 1)
win.add_widget(tree)

# so random non-string values can be used as the key for a row in a GntTree!
last = None
for i in range(1, 100):
	tree.add_row_after(i, [str(i), ""], None, i-1)
tree.add_row_after(entry, ["asd"], None, None)
tree.add_row_after("b", ["123", ""], entry, None)

button.connect("activate", button_activate, tree)

win.show()

gnt.gnt_main()

gnt.gnt_quit()