1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146
|
<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gdkdragcontext">
<refnamediv>
<refname>gtk.gdk.DragContext</refname>
<refpurpose>an object containing the drag and drop context
data</refpurpose>
</refnamediv>
<refsect1>
<title>Synopsis</title>
<classsynopsis language="python">
<ooclass><classname>gtk.gdk.DragContext</classname></ooclass>
<ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
<constructorsynopsis language="python">
<methodname><link
linkend="constructor-gdkdragcontext">gtk.gdk.DragContext</link></methodname>
<methodparam></methodparam> </constructorsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-status">drag_status</link></methodname>
<methodparam><parameter
role="keyword">action</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drop-reply">drop_reply</link></methodname>
<methodparam><parameter role="keyword">ok</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drop-finish">drop_finish</link></methodname>
<methodparam><parameter
role="keyword">success</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-get-selection">drag_get_selection</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-find-window">drag_find_window</link></methodname>
<methodparam><parameter
role="keyword">drag_window</parameter></methodparam>
<methodparam><parameter
role="keyword">x_root</parameter></methodparam>
<methodparam><parameter
role="keyword">y_root</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link linkend="method-gdkdragcontext--drag-find-window-for-screen">drag_find_window_for_screen</link></methodname>
<methodparam><parameter
role="keyword">drag_window</parameter></methodparam>
<methodparam><parameter
role="keyword">screen</parameter></methodparam>
<methodparam><parameter
role="keyword">x_root</parameter></methodparam>
<methodparam><parameter
role="keyword">y_root</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-motion">drag_motion</link></methodname>
<methodparam><parameter
role="keyword">dest_window</parameter></methodparam>
<methodparam><parameter
role="keyword">protocol</parameter></methodparam>
<methodparam><parameter
role="keyword">x_root</parameter></methodparam>
<methodparam><parameter
role="keyword">y_root</parameter></methodparam>
<methodparam><parameter
role="keyword">suggested_action</parameter></methodparam>
<methodparam><parameter
role="keyword">possible_actions</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-drop">drag_drop</link></methodname>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-abort">drag_abort</link></methodname>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--finish">finish</link></methodname>
<methodparam><parameter
role="keyword">success</parameter></methodparam>
<methodparam><parameter
role="keyword">del_</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--get-source-widget">get_source_widget</link></methodname>
<methodparam></methodparam> </methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--set-icon-widget">set_icon_widget</link></methodname>
<methodparam><parameter
role="keyword">widget</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--set-icon-pixmap">set_icon_pixmap</link></methodname>
<methodparam><parameter
role="keyword">colormap</parameter></methodparam>
<methodparam><parameter
role="keyword">pixmap</parameter></methodparam>
<methodparam><parameter
role="keyword">mask</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--set-icon-pixbuf">set_icon_pixbuf</link></methodname>
<methodparam><parameter
role="keyword">pixbuf</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--set-icon-stock">set_icon_stock</link></methodname>
<methodparam><parameter
role="keyword">stock_id</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--set-icon-name">set_icon_name</link></methodname>
<methodparam><parameter
role="keyword">icon_name</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--set-icon-default">set_icon_default</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
<methodsynopsis language="python">
<methodname><link
linkend="method-gdkdragcontext--drag-drop-succeeded">drag_drop_succeeded</link></methodname>
<methodparam></methodparam>
</methodsynopsis>
</classsynopsis>
</refsect1>
<refsect1>
<title>Ancestry</title>
<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
+-- <link linkend="class-gdkdragcontext">gtk.gdk.DragContext</link>
</synopsis>
</refsect1>
<refsect1>
<title>Attributes</title>
<blockquote role="properties">
<informaltable pgwide="1" frame="none">
<tgroup cols="3">
<?dbhtml cellpadding="5"?>
<colspec column="1" colwidth="1in"/>
<colspec column="2" colwidth="1in"/>
<colspec column="3" colwidth="4in"/>
<tbody>
<row valign="top">
<entry>"action"</entry>
<entry>Read</entry>
<entry>the action chosen by the destination. One of:
<literal>gtk.gdk.ACTION_COPY</literal>,
<literal>gtk.gdk.ACTION_MOVE</literal>,
<literal>gtk.gdk.ACTION_LINK</literal>,
<literal>gtk.gdk.ACTION_PRIVATE</literal></entry>
</row>
<row valign="top">
<entry>"actions"</entry>
<entry>Read</entry>
<entry>a bitmask of actions proposed by the source when
<literal>suggested_action</literal> is
<literal>gtk.gdk.ACTION_ASK</literal>. A combination of:
<literal>gtk.gdk.ACTION_COPY</literal>,
<literal>gtk.gdk.ACTION_MOVE</literal>,
<literal>gtk.gdk.ACTION_LINK</literal>,
<literal>gtk.gdk.ACTION_PRIVATE</literal></entry>
</row>
<row valign="top">
<entry>"dest_window"</entry>
<entry>Read</entry>
<entry>the destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> of
this drag.</entry>
</row>
<row valign="top">
<entry>"is_source"</entry>
<entry>Read</entry>
<entry>if True the context is used on the source side.</entry>
</row>
<row valign="top">
<entry>"protocol"</entry>
<entry>Read</entry>
<entry>the DND protocol which governs this drag - one of:
<literal>gtk.gdk.DRAG_PROTO_MOTIF</literal>,
<literal>gtk.gdk.DRAG_PROTO_XDND</literal>,
<literal>gtk.gdk.DRAG_PROTO_ROOTWIN</literal>,
<literal>gtk.gdk.DRAG_PROTO_NONE</literal>,
<literal>gtk.gdk.DRAG_PROTO_WIN32_DROPFILES</literal>,
<literal>gtk.gdk.DRAG_PROTO_OLE2</literal>,
<literal>gtk.gdk.DRAG_PROTO_LOCAL</literal></entry>
</row>
<row valign="top">
<entry>"source_window"</entry>
<entry>Read</entry>
<entry>the source <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> of
this drag.</entry>
</row>
<row valign="top">
<entry>"start_time"</entry>
<entry>Read</entry>
<entry>a timestamp recording the start time of this
drag.</entry>
</row>
<row valign="top">
<entry>"suggested_action"</entry>
<entry>Read</entry>
<entry>the action suggested by the source. One of:
<literal>gtk.gdk.ACTION_DEFAULT</literal>,
<literal>gtk.gdk.ACTION_COPY</literal>,
<literal>gtk.gdk.ACTION_MOVE</literal>,
<literal>gtk.gdk.ACTION_LINK</literal>,
<literal>gtk.gdk.ACTION_PRIVATE</literal>,
<literal>gtk.gdk.ACTION_ASK</literal></entry>
</row>
<row valign="top">
<entry>"targets"</entry>
<entry>Read</entry>
<entry>a list of targets offered by the source.</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</blockquote>
</refsect1>
<refsect1>
<title>Description</title>
<para>A <link
linkend="class-gdkdragcontext"><classname>gtk.gdk.DragContext</classname></link>
holds information about a drag in progress. It is used for both source and
destination. A <link
linkend="class-gdkdragcontext"><classname>gtk.gdk.DragContext</classname></link>
can be created using the <link
linkend="constructor-gdkdragcontext">gtk.gdk.DragContext</link>()
constructor but since there is no way to set its attributes the new object
is not much use. Useful <link
linkend="class-gdkdragcontext"><classname>gtk.gdk.DragContext</classname></link>
objects are created as a result of the <link
linkend="method-gdkwindow--drag-begin"><methodname>gtk.gdk.Window.drag_begin</methodname>()</link>
or the <link
linkend="method-gtkwidget--drag-begin"><methodname>gtk.Widget.drag_begin</methodname>()</link>
methods.</para>
</refsect1>
<refsect1 id="constructor-gdkdragcontext">
<title>Constructor</title>
<programlisting><constructorsynopsis language="python">
<methodname>gtk.gdk.DragContext</methodname>
<methodparam></methodparam> </constructorsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a new <link
linkend="class-gdkdragcontext"><classname>gtk.gdk.DragContext</classname></link></simpara></listitem>
</varlistentry>
</variablelist>
<para>Creates a new <link
linkend="class-gdkdragcontext"><classname>gtk.gdk.DragContext</classname></link>
object.</para>
</refsect1>
<refsect1>
<title>Methods</title>
<refsect2 id="method-gdkdragcontext--drag-status">
<title>gtk.gdk.DragContext.drag_status</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_status</methodname>
<methodparam><parameter
role="keyword">action</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">action</parameter> :</term>
<listitem><simpara>a drag action that will be taken when a drop
happens</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the timestamp for this
action</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_status</methodname>() method sets the
specified <parameter>action</parameter> to be taken when a drop happens. The
value of <parameter>action</parameter> is one of:</para>
<variablelist>
<varlistentry>
<term><literal>gtk.gdk.ACTION_DEFAULT</literal></term>
<listitem>
<simpara></simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.ACTION_COPY</literal></term>
<listitem>
<simpara>Copy the data.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.ACTION_MOVE</literal></term>
<listitem>
<simpara>Move the data, i.e. first copy it, then delete it from
the source using the DELETE target of the X selection protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.ACTION_LINK</literal></term>
<listitem>
<simpara>Add a link to the data. Note that this is only useful
if source and destination agree on what it means.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.ACTION_PRIVATE</literal></term>
<listitem>
<simpara>Special action which tells the source that the
destination will do something that the source doesn't understand.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.ACTION_ASK</literal></term>
<listitem>
<simpara>Ask the user what to do with the data.</simpara>
</listitem>
</varlistentry>
</variablelist>
<para>The time the action occurred is specified by
<parameter>time</parameter>. This method is called by the drag destination
in response to <link
linkend="method-gdkdragcontext--drag-motion"><methodname>drag_motion</methodname>()</link>
called by the drag source.
</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drop-reply">
<title>gtk.gdk.DragContext.drop_reply</title>
<programlisting><methodsynopsis language="python">
<methodname>drop_reply</methodname>
<methodparam><parameter
role="keyword">ok</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">ok</parameter> :</term>
<listitem><simpara>if <literal>True</literal> the drop is accepted
by the destination</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the timestamp</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drop_reply</methodname>() method determines if
the drop is accepted or rejected according to the value specified by
<parameter>ok</parameter>. If <parameter>ok</parameter> is
<literal>True</literal> the drop is accepted. <parameter>time</parameter>
specifies the time that the drop reply occurred. This method is called by
the drag destination when a drop is initiated by the drag source.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drop-finish">
<title>gtk.gdk.DragContext.drop_finish</title>
<programlisting><methodsynopsis language="python">
<methodname>drop_finish</methodname>
<methodparam><parameter
role="keyword">success</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">success</parameter> :</term>
<listitem><simpara>if True the data was
received</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the time of the finish</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drop_finish</methodname>() method ends a drag
operation and indicates if the drop was successful by setting the value of
<parameter>success</parameter>. <parameter>time</parameter> indicates the
time of the drop finish. This method is called by the drag
destination.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-get-selection">
<title>gtk.gdk.DragContext.drag_get_selection</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_get_selection</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the selection atom</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_get_selection</methodname>() method returns
the selection atom for the current source window.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-find-window">
<title>gtk.gdk.DragContext.drag_find_window</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_find_window</methodname>
<methodparam><parameter
role="keyword">drag_window</parameter></methodparam>
<methodparam><parameter
role="keyword">x_root</parameter></methodparam>
<methodparam><parameter
role="keyword">y_root</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">drag_window</parameter> :</term>
<listitem><simpara>a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link></simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">x_root</parameter> :</term>
<listitem><simpara>the x position of the pointer in root
coordinates.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">y_root</parameter> :</term>
<listitem><simpara>the y position of the pointer in root
coordinates.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a 2-tuple containing the drag destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
the drag protocol</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_find_window</methodname>() method returns a
2-tuple containing the drag destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
the drag protocol being used. The drag protocol is one of:</para>
<variablelist>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_MOTIF</literal></term>
<listitem>
<simpara>The Motif DND protocol. </simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_XDND</literal></term>
<listitem>
<simpara>The Xdnd protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_ROOTWIN</literal></term>
<listitem>
<simpara>An extension to the Xdnd protocol for unclaimed root
window drops. </simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_NONE</literal></term>
<listitem>
<simpara>no protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_WIN32_DROPFILES</literal></term>
<listitem>
<simpara>The simple WM_DROPFILES protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_OLE2</literal></term>
<listitem>
<simpara>The complex OLE2 DND protocol (not
implemented).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_LOCAL</literal></term>
<listitem>
<simpara>Intra-application DND.</simpara>
</listitem>
</varlistentry>
</variablelist>
<para><parameter>drag_window</parameter> is a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
<parameter>x_root</parameter> and <parameter>y_root</parameter> specify the
location of the mouse pointer in the root window.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-find-window-for-screen">
<title>gtk.gdk.DragContext.drag_find_window_for_screen</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_find_window_for_screen</methodname>
<methodparam><parameter
role="keyword">drag_window</parameter></methodparam>
<methodparam><parameter
role="keyword">screen</parameter></methodparam>
<methodparam><parameter
role="keyword">x_root</parameter></methodparam>
<methodparam><parameter
role="keyword">y_root</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">drag_window</parameter> :</term>
<listitem><simpara>a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link></simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">screen</parameter> :</term>
<listitem><simpara>a <link
linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link></simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">x_root</parameter> :</term>
<listitem><simpara>the x position of the pointer in root
coordinates.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">y_root</parameter> :</term>
<listitem><simpara>the y position of the pointer in root
coordinates.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>a 2-tuple containing the drag destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
the drag protocol</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.2 and above.</para>
</note>
<para>The <methodname>drag_find_window_for_screen</methodname>()
method returns a 2-tuple containing the drag destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
the drag protocol being used. The drag protocol is one of:</para>
<variablelist>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_MOTIF</literal></term>
<listitem>
<simpara>The Motif DND protocol. </simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_XDND</literal></term>
<listitem>
<simpara>The Xdnd protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_ROOTWIN</literal></term>
<listitem>
<simpara>An extension to the Xdnd protocol for unclaimed root
window drops. </simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_NONE</literal></term>
<listitem>
<simpara>no protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_WIN32_DROPFILES</literal></term>
<listitem>
<simpara>The simple WM_DROPFILES protocol.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_OLE2</literal></term>
<listitem>
<simpara>The complex OLE2 DND protocol (not
implemented).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>gtk.gdk.DRAG_PROTO_LOCAL</literal></term>
<listitem>
<simpara>Intra-application DND.</simpara>
</listitem>
</varlistentry>
</variablelist>
<para><parameter>drag_window</parameter> is a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> and
<parameter>x_root</parameter> and <parameter>y_root</parameter> specify the
location of the mouse pointer in the root window.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-motion">
<title>gtk.gdk.DragContext.drag_motion</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_motion</methodname>
<methodparam><parameter
role="keyword">dest_window</parameter></methodparam>
<methodparam><parameter
role="keyword">protocol</parameter></methodparam>
<methodparam><parameter
role="keyword">x_root</parameter></methodparam>
<methodparam><parameter
role="keyword">y_root</parameter></methodparam>
<methodparam><parameter
role="keyword">suggested_action</parameter></methodparam>
<methodparam><parameter
role="keyword">possible_actions</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter
role="keyword">dest_window</parameter> :</term>
<listitem><simpara>the destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> the
drag is moving over</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">protocol</parameter> :</term>
<listitem><simpara>the drag protocol in use</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">x_root</parameter> :</term>
<listitem><simpara>the x root coordinate of the mouse
pointer</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">y_root</parameter> :</term>
<listitem><simpara>the y root coordinate of the mouse
pointer</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter
role="keyword">suggested_action</parameter> :</term>
<listitem><simpara>the suggest drag action</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter
role="keyword">possible_actions</parameter> :</term>
<listitem><simpara>the possible drag actions</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the timestamp of the drag
motion</simpara></listitem>
</varlistentry>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>True if there is a drag destination window and
the drag has paused or a drop has occurred.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_motion</methodname>() method updates the
drag context when the pointer moves or the set of actions changes. This
method is called by the drag source. <parameter>dest_window</parameter>
specifies the drag destination <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>;
<parameter>protocol</parameter> specifies the drag protocol being used (see
the <link
linkend="method-gdkdragcontext--drag-find-window"><methodname>drag_find_window</methodname>()</link>
method for details); <parameter>x_root</parameter> and
<parameter>y_root</parameter> specify the root window coordinates of the
mouse pointer; <parameter>suggested_action</parameter> specifies the
suggested drag action (see the <link
linkend="method-gdkdragcontext--drag-status"><methodname>drag_status</methodname>()</link>
method for more detail); possible_actions specifies the possible drag
actions for the drag (see the <link
linkend="method-gdkdragcontext--drag-status"><methodname>drag_status</methodname>()</link>
method for more detail); and, <parameter>time</parameter> specifies the
timestamp of the drag motion.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-drop">
<title>gtk.gdk.DragContext.drag_drop</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_drop</methodname>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the timestamp of the drag
drop.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_drop</methodname>() method initiates a drop
on the current drag destination at the time specified by
<parameter>time</parameter>. This method is called by the drag
source.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-abort">
<title>gtk.gdk.DragContext.drag_abort</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_abort</methodname>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the time of the drag abort
operation</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_abort</methodname>() method aborts the
current drag operation at the specified <parameter>time</parameter>. No drop
operation is initiated. This method is called by the drag source.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--finish">
<title>gtk.gdk.DragContext.finish</title>
<programlisting><methodsynopsis language="python">
<methodname>finish</methodname>
<methodparam><parameter
role="keyword">success</parameter></methodparam>
<methodparam><parameter
role="keyword">del_</parameter></methodparam>
<methodparam><parameter
role="keyword">time</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">success</parameter> :</term>
<listitem><simpara>if <literal>True</literal> the drop was
completed</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">del_</parameter> :</term>
<listitem><simpara>if <literal>True</literal> the drag source
should delete the source data</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">time</parameter> :</term>
<listitem><simpara>the time of the drag finish
operation.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>finish</methodname>() method informs the drag
source that the drop is finished, and that the data of the drag will no
longer be required. If <parameter>success</parameter> is
<literal>True</literal> the drag drop completed successfully; if
<parameter>del_</parameter> is <literal>True</literal> the source data
should be deleted; <parameter>time</parameter> is the timestamp of the
finish operation. This method is called by the drag destination.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--get-source-widget">
<title>gtk.gdk.DragContext.get_source_widget</title>
<programlisting><methodsynopsis language="python">
<methodname>get_source_widget</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara>the source <link
linkend="class-gtkwidget"><classname>gtk.Widget</classname></link> if the
drag is within the same application or <literal>None</literal>
otherwise.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>get_source_widget</methodname>() method returns
the source <link
linkend="class-gtkwidget"><classname>gtk.Widget</classname></link> if the
drag is within the application; otherwise <literal>None</literal> is
returned.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--set-icon-widget">
<title>gtk.gdk.DragContext.set_icon_widget</title>
<programlisting><methodsynopsis language="python">
<methodname>set_icon_widget</methodname>
<methodparam><parameter
role="keyword">widget</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">widget</parameter> :</term>
<listitem><simpara>a toplevel window to use as an
icon.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_x</parameter> :</term>
<listitem><simpara>the X offset within
<parameter>widget</parameter> of the hotspot.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_y</parameter> :</term>
<listitem><simpara>the Y offset within
<parameter>widget</parameter> of the hotspot.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_icon_widget</methodname>() method changes
the icon for a drag source to the specified <parameter>widget</parameter>
with its hot spot at the offset specified by <parameter>hot_x</parameter>
and <parameter>hot_y</parameter>. <literal>PyGTK</literal> will not destroy
the icon, so if you don't want it to persist, you should connect to the
"drag_end" signal and destroy it yourself.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--set-icon-pixmap">
<title>gtk.gdk.DragContext.set_icon_pixmap</title>
<programlisting><methodsynopsis language="python">
<methodname>set_icon_pixmap</methodname>
<methodparam><parameter
role="keyword">colormap</parameter></methodparam>
<methodparam><parameter
role="keyword">pixmap</parameter></methodparam>
<methodparam><parameter
role="keyword">mask</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">colormap</parameter> :</term>
<listitem><simpara>the colormap of the icon</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">pixmap</parameter> :</term>
<listitem><simpara>the <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> image
data for the icon</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">mask</parameter> :</term>
<listitem><simpara>the <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
transparency mask for the icon</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_x</parameter> :</term>
<listitem><simpara>the X offset within
<parameter>pixmap</parameter> of the hotspot.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_y</parameter> :</term>
<listitem><simpara>the Y offset within
<parameter>pixmap</parameter> of the hotspot.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_icon_pixmap</methodname>() method sets
<parameter>pixmap</parameter> as the icon for the drag.
<parameter>mask</parameter> is a bitmap mask for
<parameter>pixmap</parameter> and <parameter>hot_x</parameter> and
<parameter>hot_y</parameter> specify the offset of the hot spot in
<parameter>pixmap</parameter>. In general, <link
linkend="method-gdkdragcontext--set-icon-pixbuf"><function>gtk.gdk.DragContext.set_icon_pixbuf()</function></link>
will be more convenient to use.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--set-icon-pixbuf">
<title>gtk.gdk.DragContext.set_icon_pixbuf</title>
<programlisting><methodsynopsis language="python">
<methodname>set_icon_pixbuf</methodname>
<methodparam><parameter
role="keyword">pixbuf</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">pixbuf</parameter> :</term>
<listitem><simpara>the <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> to
use as the drag icon.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_x</parameter> :</term>
<listitem><simpara>the X offset within
<parameter>pixbuf</parameter> of the hotspot.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_y</parameter> :</term>
<listitem><simpara>the Y offset within
<parameter>pixbuf</parameter> of the hotspot.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_icon_pixbuf</methodname>() method sets
<parameter>pixbuf</parameter> as the icon for the drag.
<parameter>hot_x</parameter> and <parameter>hot_y</parameter> specify the
offset of the hot spot within <parameter>pixbuf</parameter>.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--set-icon-stock">
<title>gtk.gdk.DragContext.set_icon_stock</title>
<programlisting><methodsynopsis language="python">
<methodname>set_icon_stock</methodname>
<methodparam><parameter
role="keyword">stock_id</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">stock_id</parameter> :</term>
<listitem><simpara>the ID of the stock icon to use for the
drag.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_x</parameter> :</term>
<listitem><simpara>the X offset within the icon of the
hotspot.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_y</parameter> :</term>
<listitem><simpara>the Y offset within the icon of the
hotspot.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>set_icon_stock</methodname>() method sets the
the icon for a given drag from a stock ID specified by
<parameter>stock_id</parameter>. <parameter>hot_x</parameter> and
<parameter>hot_y</parameter> specify the offset of the hot spot within the
stock icon.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--set-icon-name">
<title>gtk.gdk.DragContext.set_icon_name</title>
<programlisting><methodsynopsis language="python">
<methodname>set_icon_name</methodname>
<methodparam><parameter
role="keyword">icon_name</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_x</parameter></methodparam>
<methodparam><parameter
role="keyword">hot_y</parameter></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><parameter role="keyword">icon_name</parameter> :</term>
<listitem><simpara>the name of the icon to use for the
drag.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_x</parameter> :</term>
<listitem><simpara>the X offset within the icon of the
hotspot.</simpara></listitem>
</varlistentry>
<varlistentry>
<term><parameter role="keyword">hot_y</parameter> :</term>
<listitem><simpara>the Y offset within the icon of the
hotspot.</simpara></listitem>
</varlistentry>
</variablelist>
<note>
<para>This method is available in PyGTK 2.10 and above.</para>
</note>
<para>The <methodname>set_icon_name</methodname>() method sets the the
icon for a given drag from the named themed icon specified by
<parameter>icon_name</parameter>. <parameter>hot_x</parameter> and
<parameter>hot_y</parameter> specify the offset of the hot spot within the
stock icon. See the docs for <link
linkend="class-gtkicontheme"><classname>gtk.IconTheme</classname></link> for
more information. Note that the size of the icon depends on the icon theme
(the icon is loaded at the symbolic size
<literal>gtk.ICON_SIZE_DND</literal>), thus <parameter>hot_x</parameter> and
<parameter>hot_y</parameter> have to be used with care.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--set-icon-default">
<title>gtk.gdk.DragContext.set_icon_default</title>
<programlisting><methodsynopsis language="python">
<methodname>set_icon_default</methodname>
<methodparam></methodparam> </methodsynopsis></programlisting>
<para>The <methodname>set_icon_default</methodname>() method sets the
icon for the drag to the default icon.</para>
</refsect2>
<refsect2 id="method-gdkdragcontext--drag-drop-succeeded">
<title>gtk.gdk.DragContext.drag_drop_succeeded</title>
<programlisting><methodsynopsis language="python">
<methodname>drag_drop_succeeded</methodname>
<methodparam></methodparam>
</methodsynopsis></programlisting>
<variablelist>
<varlistentry>
<term><emphasis>Returns</emphasis> :</term>
<listitem><simpara><literal>True</literal> if the drop was
successful.</simpara></listitem>
</varlistentry>
</variablelist>
<para>The <methodname>drag_drop_succeeded</methodname>() method
returns <literal>True</literal> if the dropped data has been successfully
transferred. This method is intended to be used while handling a
<literal>gtk.gdk.DROP_FINISHED</literal> event, its return value is
meaningless at other times.</para>
</refsect2>
</refsect1>
</refentry>
|