Vikipediya:Qumloq: Versiyalar orasidagi farq

Kontent oʻchirildi Kontent qoʻshildi
Tahrir izohi yoʻq
Tahrir izohi yoʻq
Qator 4:
[[category:test]]
[[turkum:test2]]
Then you’ll have to handle the Widget "drag-data-received" signal to receive that dropped data - perhaps replacing
Bir nima
the data in the row it was dropped on. The signature for the callback for the "drag-data-received" signal is:
def callback(widget, drag_context, x, y, selection_data, info, timestamp)
where widget is the TreeView, drag_context is a DragContext containing the context of the selection, x
and y are the position where the drop occurred, selection_data is the SelectionData containing the data,
info is the ID integer of the type, timestamp is the time when the drop occurred. The row can be identified by
calling the method:
drop_info = treeview.get_dest_row_at_pos(x, y)
where (x, y) is the position passed to the callback function and drop_info is a 2-tuple containing the path of a
row and a position constant indicating where the drop is with respect to the row: gtk.TREE_VIEW_DROP_BEFORE,
gtk.TREE_VIEW_DROP_AFTER, gtk.TREE_VIEW_DROP_INTO_OR_BEFORE or gtk.TREE_VIEW_DROP_INTO_OR_A
The callback function could be something like:
treeview.enable_model_drag_dest([(’text/plain’, 0, 0)],
gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE)
treeview.connect("drag-data-received", drag_data_received_cb)
...
...
def drag_data_received_cb(treeview, context, x, y, selection, info, ←
timestamp):
drop_info = treeview.get_dest_row_at_pos(x, y)
if drop_info:
model = treeview.get_model()
257