Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"The four building blocks of the universe are fire, water, gravel and vinyl." -- Dave Barry


devel / comp.lang.perl.misc / How to stack 2 buttons and attach a 3rd full height ?

SubjectAuthor
* How to stack 2 buttons and attach a 3rd full height ?$Bill
`* Re: How to stack 2 buttons and attach a 3rd full height ?$Bill
 `- Re: How to stack 2 buttons and attach a 3rd full height ?George Bouras

1
How to stack 2 buttons and attach a 3rd full height ?

<sh963g$f8p$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=177&group=comp.lang.perl.misc#177

  copy link   Newsgroups: comp.lang.perl.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: UNews2Bill@RemovEgmail.com ($Bill)
Newsgroups: comp.lang.perl.misc
Subject: How to stack 2 buttons and attach a 3rd full height ?
Date: Tue, 7 Sep 2021 19:10:57 -0700
Organization: A noiseless patient Spider
Lines: 123
Message-ID: <sh963g$f8p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 8 Sep 2021 02:10:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d895b6cd6ce67df6e3375ac716a27ae9";
logging-data="15641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+0WovIRoCdbxCMR5aKpGFQOl6zd8e7moE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:VWSDcn+oXIKT8aKtBSuai2tMQlw=
Content-Language: en-US
X-Mozilla-News-Host: news://news://news.eternal-september.org:119
 by: $Bill - Wed, 8 Sep 2021 02:10 UTC

(no activity in Tk groups so trying here)

I have 3 buttons - let's call them Abcd, Efgh and STOP (that's the text in them) that I want
to stack prior to a LabelFrame.

I want the buttons to look like in the test code example below.

Please feel free to modify the code in frames $f4/5 to get the proper packing shown below.
I've tried hundreds of combinations with no luck.

########################## Test Code #####################################################
#!perl --

use strict; use warnings; no warnings qw(once);

require Tk;
require Tk::widgets;
import Tk::widgets qw(Button Entry Frame Label Labelframe ROText Scrollbar);

my $ffam = 'Fixedsys';
my $fwt = 'Medium'; my $fsl = 'R'; my $fwd = 'Normal'; my $fpx = '120';
my $font = "-*-$ffam-$fwt-$fsl-$fwd-*-*-$fpx-*-*-*-*-*-*";
my $windowWidth = 80;

my $mw = new MainWindow (-title => "Test GUI ($$)");
# stripped f1 and f2 out
my $f3 = $mw->Frame->pack(-anchor => 'w', -fill => 'both', -expand => 1);
my $t31 = $f3->ROText(-font => $font, -width => 8, -height => 1,
-relief => 'flat')->pack(-side => 'left');
$t31->Contents('T31=');
my $i31 = $f3->Entry(-font => $font, -width => 12, -validate => 'none',
)->pack(-side => 'left', -fill => 'both', -expand => 1);
my $t32 = $f3->ROText(-font => $font, -width => 4, -height => 1,
-relief => 'flat')->pack(-side => 'left');
$t32->Contents('T32');
my $i32 = $f3->Entry(-font => $font, -width => 32, -validate => 'none',
)->pack(-side => 'left', -fill => 'both', -expand => 1);
my $t33 = $f3->ROText(-font => $font, -width => 7, -height => 1,
-relief => 'flat')->pack(-side => 'left');
$t33->Contents('T33');
my $i33 = $f3->Entry(-font => $font, -width => 24, -validate => 'none',
)->pack(-side => 'left', -fill => 'both', -expand => 1);

my $f4 = $mw->Frame->pack(-anchor => 'w', -fill => 'both', -expand => 1);

our $b41; # temp
our $b42;
our $b43;
our $lf1;

# right now I can get it to this:
#|----| |----| |
#|Abcd| | |--Title-------------------------------------------------------|
#|----|----|STOP| Label Frame (x scrolled Listbox - 1 line) |
#| |Efgh| |<------scroll bar-------------------------------------------->|
#| |----|----| |

# But I want this:
#|----|----| |
#|Abcd| |--Title------------------------------------------------------------|
#|----|STOP| Label Frame (x scrolled Listbox - 1 line) |
#|Efgh| |<------scroll bar------------------------------------------------->|
#|----|----| |

# STOP should be centered in double high button and be to the right of the 2
# smaller one line buttons on left (Abcd & Efgh) which I can't get to stack.

#----- Stuff that needs proper packing below with latest failing attempt -------

$b41 = $f4->Button(-text => 'Abcd', -font => $font,
-foreground => 'red', -command => sub { ; }
)->pack(-side => 'left', -anchor => 'nw', -fill => 'none', -expand => 0, );

$b42 = $f4->Button(-text => 'Efgh', -font => $font,
-foreground => 'black', -command => sub { ; }
)->pack(-side => 'left', -anchor => 'sw', -fill => 'none', -expand => 0, );

$b43 = $f4->Button(-text => 'STOP', -font => $font,
-foreground => 'black', -command => sub { ; },
)->pack(-side => 'left', -after => $b42, -fill => 'y', -expand => 0);

#----- End Stuff that needs proper packing but below might need changes to $lf1
#----- packing due to any changes above --------------------------------------

#--------- Progress Frame Listbox w/Scrollbars -------------------------------
$lf1 = $f4->Labelframe(-text => 'Progress', -font => $font,
-relief => 'ridge')->pack(-fill => 'both', -expand => 1);

#----------------Below should not need any help ------------------------------
my $lb1 = $lf1->Scrolled('Listbox', -scrollbars => 's',
-font => $font, -relief => 'sunken', -width => $windowWidth, -height => 1,
)->pack(-side => 'bottom', -fill => 'both', -expand => 1);

my $lf2 = $mw->Labelframe(-text => 'Log', -font => $font,
-relief => 'ridge')->pack(-fill => 'both', -expand => 1);

my $lb2 = $lf2->Scrolled('Listbox', -scrollbars => 'ose',
-font => $font, -relief => 'sunken', -width => $windowWidth, -height => 12,
-setgrid => 1, -selectmode => 'extended',
)->pack(-side => 'bottom', -fill => 'both', -expand => 1);

# ignore the why for this mainloop code
our $InTk = 0;
our $ML = '
$InTk = 1;
unless ($Tk::inMainLoop) {
$Tk::inMainLoop = 1;
while (Tk::MainWindow->Count) {
Tk::DoOneEvent (0);
}
$Tk::inMainLoop = 0;
}
$InTk = 0;
';
eval $ML;

__END__

######################################################################################

Re: How to stack 2 buttons and attach a 3rd full height ?

<sha06q$tem$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=178&group=comp.lang.perl.misc#178

  copy link   Newsgroups: comp.lang.perl.misc
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: UNews2Bill@RemovEgmail.com ($Bill)
Newsgroups: comp.lang.perl.misc
Subject: Re: How to stack 2 buttons and attach a 3rd full height ?
Date: Wed, 8 Sep 2021 02:36:26 -0700
Organization: A noiseless patient Spider
Lines: 1
Message-ID: <sha06q$tem$2@dont-email.me>
References: <sh963g$f8p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 8 Sep 2021 09:36:26 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d895b6cd6ce67df6e3375ac716a27ae9";
logging-data="30166"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bRVNaTvYxCzldwC2J00pPO8R6zliHs0M="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Cancel-Lock: sha1:GC780JoynPhtGYzCOB+aeGVUTJI=
In-Reply-To: <sh963g$f8p$1@dont-email.me>
Content-Language: en-US
 by: $Bill - Wed, 8 Sep 2021 09:36 UTC

Never mind, I figured it out. I didn't know you could mix pack & grid methods.

Re: How to stack 2 buttons and attach a 3rd full height ?

<shava0$6b0$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=179&group=comp.lang.perl.misc#179

  copy link   Newsgroups: comp.lang.perl.misc
Path: i2pn2.org!i2pn.org!aioe.org!XeJnFtFGyEwmBNcUtc7jDw.user.46.165.242.75.POSTED!not-for-mail
From: foo@example.com (George Bouras)
Newsgroups: comp.lang.perl.misc
Subject: Re: How to stack 2 buttons and attach a 3rd full height ?
Date: Wed, 8 Sep 2021 21:27:12 +0300
Organization: Aioe.org NNTP Server
Message-ID: <shava0$6b0$1@gioia.aioe.org>
References: <sh963g$f8p$1@dont-email.me> <sha06q$tem$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="6496"; posting-host="XeJnFtFGyEwmBNcUtc7jDw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Content-Language: el
X-Notice: Filtered by postfilter v. 0.9.2
 by: George Bouras - Wed, 8 Sep 2021 18:27 UTC

Στις 8/9/2021 12:36 μ.μ., ο/η $Bill έγραψε:
> Never mind, I figured it out.  I didn't know you could mix pack & grid
> methods.

phewww


devel / comp.lang.perl.misc / How to stack 2 buttons and attach a 3rd full height ?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor