[pygtk] Problem with label.set_selectable()

Sylvain Saleur syeric1 at gmail.com
Tue Jul 3 05:32:42 WST 2007


Hello!

I have a problem using label.set_selectable(True).

I append a page to a notebook. In this page, there are some widgets,
including a label. I want to allow the selection of the label. When I
append the page during the use of the program, the text appear
selected by default...

So I have:

def page(param):
	cadre=gtk.Frame()
	box1=gtk.HBox(False, 5)
	cadre.add(box1)
	fd=gtk.ScrolledWindow()
	fd.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
	box1.pack_start(fd, True, True, 10)
	text=chainaslist(param) #function which return return file "param"
lines as a list
	box=gtk.VBox(False, 5)
	label1=gtk.Label()
	label1.set_markup(text)
	box.pack_start(label1, False, False, 5)
	image=gtk.Image()
	image.set_from_file('file')
	box.pack_start(image, False, False, 5)
	box2=gtk.HBox(False, 5)
	boutonnext=gtk.Button("Continuer")
	boutonnext.connect("clicked", param1, param2)
	boutonprev=gtk.Button("Précédent")
	boutonprev.connect("clicked", param1, param2)
	box2.pack_start(boutonprev, False, False, 5)
	box2.pack_start(boutonnext, False, False, 5)
	box.pack_start(box2, False, False, 5)
	label1.set_selectable(True)
	fd.add_with_viewport(box)
	cadre.show_all()
	return cadre

And I run this function with

cadre=page(param)
book.append_page(cadre, label)
book.show_all()

If you need a screenshot to see the problem (because I'm not a very
good english writer...) let me know.

I look forward to hearing from you.

Cheers.

Sylvain Saleur


More information about the pygtk mailing list