Schrift
Wiki:Tipp zum Debugging: use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper \@var;
[thread]4894[/thread]

Labels in Frame packen



<< >> 7 Einträge, 1 Seite
Froschpopo
 2005-04-02 13:53
#43097 #43097
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Die schleife erstellt eine BuddyList. Da ich später eine Scrollleiste am Rand machen muss, muss ich das ganze vorab in ein Frame packen.
Wie muss man das jetzt verschachteln?
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
    foreach(@_) {
$nickname = $config{MainWindow}->Label(
-text => $user." (Online)",
-background => 'white',
-font => $config{Font}
);
        $nickname->bind('<Button-3>' => sub { $m->Popup(
            -popover => 'cursor') });
        $nickname -> place(-x=>27, -y => $singleLine);
 
    }
\n\n

<!--EDIT|Froschpopo|1112436467-->
Ishka
 2005-04-02 13:56
#43098 #43098
User since
2003-08-04
771 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Hab keine Lust mir den Code durchzulesen (solltest mal versuchen Minimalbeispiele zu posten), aber ein Label in einem Frame erzeugst du so:
Code: (dl )
1
2
my $frame=$main->Frame->pack;
my $label=$frame->Label(-text=>'Hallo auch')->pack;
sub z{if(@_){1while$x[$k=rand 10];t($t=$x[$k]=1)}print map"$z[$x[$_]]$_".($_%3?
"":"\n"),1..9}sub t{$j=0;$x[$_+1]==$t&&($j+=2**$_)for 0..8;z,die"Gewinner $z[$t]
"if grep$_==($j&$_),7,56,73,84,146,273,292,448;z,die"Gleichstand\n"if@x>9&&!grep
!$_,@x}@x=4;@z=qw{. [ (};z$^T&1;while(<>){next if$_>9||$x[$_];t$t=$x[$_]=2;z 1}
Froschpopo
 2005-04-02 14:06
#43099 #43099
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
habs editiert (siehe oben).
Ishka
 2005-04-02 14:11
#43100 #43100
User since
2003-08-04
771 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
my $frame=$config{MainWindow}->place(-x=>$x,-y=>$y);
foreach(@_) {
$nickname = $frame->Label(
-text => $user." (Online)",
-background => 'white',
-font => $config{Font}
);
$nickname->bind('<Button-3>' => sub { $m->Popup(
-popover => 'cursor') });
$nickname -> place(-x=>27, -y => $singleLine);

}
sub z{if(@_){1while$x[$k=rand 10];t($t=$x[$k]=1)}print map"$z[$x[$_]]$_".($_%3?
"":"\n"),1..9}sub t{$j=0;$x[$_+1]==$t&&($j+=2**$_)for 0..8;z,die"Gewinner $z[$t]
"if grep$_==($j&$_),7,56,73,84,146,273,292,448;z,die"Gleichstand\n"if@x>9&&!grep
!$_,@x}@x=4;@z=qw{. [ (};z$^T&1;while(<>){next if$_>9||$x[$_];t$t=$x[$_]=2;z 1}
Froschpopo
 2005-04-02 14:21
#43101 #43101
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
kann ja irgendwas nicht stimmen.... can't use placer on top-level window "." use wm command instead....
Wo rufst du denn die Frame()-Funktion auf?\n\n

<!--EDIT|Froschpopo|1112437807-->
Froschpopo
 2005-04-02 15:09
#43102 #43102
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
ich weiss woran das liegt !
Ich hab mit dem Geometriemanager place formatiert anstatt mit pack. Ich möchte aber gerne bei place bleiben denn es gibt ne möglichkeit die Objekte auch am Frame auszurichten, weiss blos nicht wie :D
Crian
 2005-04-04 19:28
#43103 #43103
User since
2003-08-04
5866 Artikel
ModeratorIn
[Homepage]
user image
perldoc Tk::place
(Oder sollen wir da jetzt für Dich nachsehen?)
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite
<< >> 7 Einträge, 1 Seite



View all threads created 2005-04-02 13:53.