Schrift
[thread]4950[/thread]

In der Mitte von Frame plazieren



<< >> 7 Einträge, 1 Seite
Froschpopo
 2005-04-18 19:46
#43597 #43597
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
ich hab dieses Scroll-Frame:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
    $config{BuddyListPane} = $config{BuddyList}->Scrolled(
"Pane", -scrollbars => 'e',
-bg => 'red',
-width=>$config{MainWidth},
-height=>350
)->pack(-anchor=>'n');
$config{BuddyListPane}->Label(
-text => "Test",
-anchor => 'n',
-background => 'white',
)->grid(-row=>0, -column=>0, -sticky => 'n');

ich bekomme es einfach nicht gebacken, dass das Label nicht oben plaziert wird. Stattdessen steht der Text immer in der mitte des Frames...
Hab schon alle möglichen Kombinationen mit sticky, anchor, justify etc ausprobiert aber das klappt einfach nicht.
Mit mitte meine ich die vertikale.
Froschpopo
 2005-04-18 22:58
#43598 #43598
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
ich weiss genau dass ihr es wisst bei den coolen programmen die ihr in Tk so schreibt... :D
ptk
 2005-04-18 23:08
#43599 #43599
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
Du brauchst gridColumnconfigure und gridRowconfigure.
Wurde bestimmt schon mal im Forum durchgesprochen.
Froschpopo
 2005-04-18 23:22
#43600 #43600
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Code: (dl )
1
2
3
4
    $config{pane}->Label(
-text => $txt
)->grid(-row=>$config{OutputCount}, -column=>1);
$config{pane}->gridColumnconfigure(-weight => 3);

dazu sagt der mir: -weight isn't numeric...
der lügt doch
Froschpopo
 2005-04-19 00:08
#43601 #43601
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
ich glaub mal eher gridRowconfigure und das andere hat ziemlich wenig mit meinem Problem zu tun. Was ich brauche ist sowas wie -side für den pack-manager. den gibts nur leider nicht für grid
Strat
 2005-04-19 13:45
#43602 #43602
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
vielleicht hilft dir die hilfe zu -sticky weiter? perldoc Tk::grid
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/
Crian
 2005-04-19 15:47
#43603 #43603
User since
2003-08-04
5866 Artikel
ModeratorIn
[Homepage]
user image
[quote=Froschpopo,18.04.2005, 21:22]
Code: (dl )
1
2
3
4
    $config{pane}->Label(
-text => $txt
)->grid(-row=>$config{OutputCount}, -column=>1);
$config{pane}->gridColumnconfigure(-weight => 3);

dazu sagt der mir: -weight isn't numeric...
der lügt doch[/quote]
'er' lügt nie. '-weight' ist definitiv nicht numerisch.

Zitat aus der perldoc (gähn...)

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
    *$master*->gridColumnconfigure(*index*?, *-option*=>*value, ...*?)
Query or set the column properties of the *index* column of the
geometry master, *$master*. The valid options are -minsize, -weight
and -pad. If one or more options are provided, then *index* may be
given as a list of column indices to which the configuration options
will operate on. The -minsize option sets the minimum size, in
screen units, that will be permitted for this column. The -weight
option (an integer value) sets the relative weight for apportioning
any extra spaces among columns. A weight of zero (0) indicates the
column will not deviate from its requested size. A column whose
weight is two will grow at twice the rate as a column of weight one
when extra space is allocated to the layout. The -uniform option,
when a non-empty value is supplied, places the column in a *uniform
group* with other columns that have the same value for -uniform. The
space for columns belonging to a uniform group is allocated so that
their sizes are always in strict proportion to their -weight values.
See *THE GRID ALGORITHM* below for further details. The -pad option
specifies the number of screen units that will be added to the
largest window contained completely in that column when the grid
geometry manager requests a size from the containing window. If only
an option is specified, with no value, the current value of that
option is returned. If only the master window and index is
specified, all the current settings are returned in an list of
"-option value" pairs.
\n\n

<!--EDIT|Crian|1113911397-->
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-18 19:46.