Thread Tk::Thumbnail in Verbindung mit Drag and Drop: Bitte bitte helft mir weiter... (21 answers)
Opened by zipster at 2005-06-28 13:01

zipster
 2005-06-28 13:40
#44085 #44085
User since
2004-09-06
458 Artikel
BenutzerIn
[default_avatar]
Ich mach mal ein paar Auszüge da in meinem Programm viel Scheiß ist der hier nicht interessiert. :p

Code: (dl )
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
my $frame1 = $mw->Frame(
-relief=>'sunken',
-borderwidth => 5,

)->pack(
-side => 'left',
-fill => 'y'
);

my $thumb1 = $frame1->Scrolled('Thumbnail',
-scrollbars => 'e',
-iwidth => 200,
-iheight => 300,
-width => 250,
-ilabels => '0',
-zoombtn => 'right',
-cols => '1',
);
$thumb1->pack( qw/ -fill y -expand 1 / );
$thumb1->update;

$dnd_token = $thumb1->DragDrop
(-event => '<B1-Motion>',
-sitetypes => ['Local'],
-startcommand => sub { \&StartDrag($dnd_token) },
);

sub StartDrag {
print "bin in Drag";
my($token) = @_;
my $w = $token->parent; # $w is the source listbox
my $e = $w->XEvent;
my $idx = $w->nearest($e->y);
if (defined $idx)
{
$token->configure(-text => $w->get($idx));
}
my($X, $Y) = ($e->X, $e->Y);
$token->MoveToplevelWindow($X, $Y);
$token->raise;
$token->deiconify;
$token->FindSite($X, $Y, $e);
}


Wobei "StartDrag" aus einem Beispielprogramm geklaut ist.
Ist klar das das nicht funktioniert, ABER wenigstens "bin in Drag"; müßte ich doch sehen oder?

Hab auch bei
Code: (dl )
 $dnd_token = $thumb1->DragDrop
$frame1 versucht... brachte aber auch nichts.


Es verhält sich so als ob Drag and Drop garnicht da wäre...

use Strict und use Warnings wird benutzt

:)

View full thread Tk::Thumbnail in Verbindung mit Drag and Drop: Bitte bitte helft mir weiter...