[Assorted-commits] SF.net SVN: assorted:[1139] music-labeler/trunk/src/ml.py
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-01-24 11:01:43
|
Revision: 1139 http://assorted.svn.sourceforge.net/assorted/?rev=1139&view=rev Author: yangzhang Date: 2009-01-24 11:01:40 +0000 (Sat, 24 Jan 2009) Log Message: ----------- taped together a "working" positioning Modified Paths: -------------- music-labeler/trunk/src/ml.py Modified: music-labeler/trunk/src/ml.py =================================================================== --- music-labeler/trunk/src/ml.py 2009-01-24 10:15:03 UTC (rev 1138) +++ music-labeler/trunk/src/ml.py 2009-01-24 11:01:40 UTC (rev 1139) @@ -103,6 +103,7 @@ l.append([m]) # Something is always selected in the list. t.get_selection().select_path(0) + t.scroll_to_cell(0) @connecting(e, 'key-press-event') def on_key_press(src, ev): @@ -173,13 +174,27 @@ s.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) tw.add(s) refresh() - ew,eh = e.size_request() - # TODO: figure out how to position the pop-up window correctly. - #tw.move() tw.show_all() # Final steps. h.pack_start(e) + @connecting_after(w, 'show') # initial, but doesn't work (too early) + @connecting_after(w, 'drag-end') # want to detect movement + @connecting_after(e, 'notify::cursor-position') + @connecting_after(e, 'focus-in-event') # hack to handle initial + def shown(*args): + ew,eh = e.size_request() + gdkwin = e.get_parent_window() + x,y = gdkwin.get_origin() + if do_debug: + a = e.get_allocation() + debug(ew, eh, a.x, a.y, a.width, a.height, gdkwin, (x,y), + gdkwin.get_position(), gdkwin.get_geometry()) + y += eh + # TODO: figure out how to position the pop-up window correctly. + tw.set_size_request(e.size_request()[0],-1) + tw.move(x,y) + w.move(0,0) w.show_all() es.append(e) main() @@ -189,5 +204,5 @@ from os.path import expanduser from urllib import quote, unquote labels = map(unquote, listdir(expanduser('~/.quodlibet/playlists/'))) - do_debug = False + do_debug = True mainwin() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |