Article View: pl.comp.lang.tcl
Article #100Re: Proszę o pomoc... newbie (jak umieścić widget w innym, albo inaczej- złożyć duży interface z kilku mniejszych)
From: BlackMoon
Date: Thu, 07 Jul 2005 21:18
Date: Thu, 07 Jul 2005 21:18
571 lines
9319 bytes
9319 bytes
Użytkownik "BlackMoon"
<chuc@i.dislike.spam.please.remove.it.from.my.email.address.dyktator.com>
napisał w wiadomości news:dajss9$98p$1@nemesis.news.tpi.pl...
> jestem początkujący no i zrobiłem sobie taki interface w kawałkach i teraz
> tego żałuje... bo nie wiem, jak te kawałki poskładać.... heh...
>
>
>
> MAM TAKI PLIK (w sumie to 2, które połączyłem) Jak mogę umieścić
> kalwaiturę_09 w polu przygotowanym jako panedwidnow1.
>
> ????
> dziękuję za wszelkie konstruktywne uwagi....
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> !/usr/bin/perl
>
> # Sample SpecTcl main program for testing GUI
>
> use Tk;
>
> my($top) = MainWindow->new();
>
> $top->title("okno test");
>
> my($main_frame) = $top->Frame()->pack(
>
> -fill=>'both',
>
> -expand=>1
>
> );
>
> # interface generated by SpecTcl (Perl enabled) version 1.2 # from okno.ui
> # For use with Tk400.202, using the gridbag geometry manager
>
> sub okno_ui {
>
> my($root) = @_;
>
> # widget creation
>
> my($panedwindow_1) = $root->Panedwindow (
>
> );
>
> my($canvas_3) = $root->Canvas (
>
> -height => '0',
>
> -selectbackground => '#c3c3c3',
>
> -selectforeground => 'Black',
>
> -width => '0',
>
> );
>
> # Geometry management
>
> $panedwindow_1->grid(
>
> -in => $root,
>
> -column => '2',
>
> -row => '1'
>
> );
>
> $canvas_3->grid(
>
> -in => $root,
>
> -column => '1',
>
> -row => '2',
>
> -sticky => 'nesw'
>
> );
>
> # Resize behavior management
>
> # container $root (rows)
>
> $root->gridRowconfigure(1, -weight => 0, -minsize => 144);
>
> $root->gridRowconfigure(2, -weight => 0, -minsize => 201);
>
> # container $root (columns)
>
> $root->gridColumnconfigure(1, -weight => 0, -minsize => 274);
>
> $root->gridColumnconfigure(2, -weight => 0, -minsize => 461);
>
> # additional interface code
>
> # end additional interface code
>
> }
>
> sub klawiatura_09_ui {
>
> my($root) = @_;
>
> # widget creation
>
> my($button_1) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -padx => '0',
>
> -pady => '0',
>
> -relief => 'ridge',
>
> -text => '7',
>
> );
>
> my($button_2) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '8',
>
> );
>
> my($button_3) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '9',
>
> );
>
> my($button_13) = $root->Button (
>
> -background => 'bisque',
>
> -font => '-*-helvetica-Medium-R-Normal-*-*-200-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => 'Ilosc',
>
> );
>
> my($button_16) = $root->Button (
>
> -background => 'bisque',
>
> -font => '-*-helvetica-Medium-R-Normal-*-*-180-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => 'Cena',
>
> );
>
> my($button_4) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -padx => '0',
>
> -pady => '0',
>
> -relief => 'ridge',
>
> -text => '4',
>
> );
>
> my($button_5) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '5',
>
> );
>
> my($button_6) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '6',
>
> );
>
> my($button_14) = $root->Button (
>
> -background => 'bisque',
>
> -font => '-*-helvetica-Medium-R-Normal-*-*-200-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => 'Waga',
>
> );
>
> my($button_7) = $root->Button (
>
> -font => '-*-helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -padx => '0',
>
> -pady => '0',
>
> -relief => 'ridge',
>
> -text => '1',
>
> );
>
> my($button_8) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '2',
>
> );
>
> my($button_9) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '3',
>
> );
>
> my($button_15) = $root->Button (
>
> -background => 'bisque',
>
> -font => '-*-helvetica-Medium-R-Normal-*-*-200-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => 'KOD',
>
> );
>
> my($button_10) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '0',
>
> );
>
> my($button_11) = $root->Button (
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => '.',
>
> );
>
> my($button_12) = $root->Button (
>
> -background => '#f68928',
>
> -font => '-*-Helvetica-Bold-R-Normal-*-*-280-*-*-*-*-*-*',
>
> -relief => 'ridge',
>
> -text => 'C',
>
> );
>
> # Geometry management
>
> $button_1->grid(
>
> -in => $root,
>
> -column => '1',
>
> -row => '1',
>
> -sticky => 'nesw'
>
> );
>
> $button_2->grid(
>
> -in => $root,
>
> -column => '2',
>
> -row => '1',
>
> -sticky => 'nesw'
>
> );
>
> $button_3->grid(
>
> -in => $root,
>
> -column => '3',
>
> -row => '1',
>
> -sticky => 'nesw'
>
> );
>
> $button_13->grid(
>
> -in => $root,
>
> -column => '4',
>
> -row => '1',
>
> -sticky => 'nesw'
>
> );
>
> $button_16->grid(
>
> -in => $root,
>
> -column => '5',
>
> -row => '1',
>
> -sticky => 'nesw'
>
> );
>
> $button_4->grid(
>
> -in => $root,
>
> -column => '1',
>
> -row => '2',
>
> -sticky => 'nesw'
>
> );
>
> $button_5->grid(
>
> -in => $root,
>
> -column => '2',
>
> -row => '2',
>
> -sticky => 'nesw'
>
> );
>
> $button_6->grid(
>
> -in => $root,
>
> -column => '3',
>
> -row => '2',
>
> -sticky => 'nesw'
>
> );
>
> $button_14->grid(
>
> -in => $root,
>
> -column => '4',
>
> -row => '2',
>
> -columnspan => '2',
>
> -sticky => 'nesw'
>
> );
>
> $button_7->grid(
>
> -in => $root,
>
> -column => '1',
>
> -row => '3',
>
> -sticky => 'nesw'
>
> );
>
> $button_8->grid(
>
> -in => $root,
>
> -column => '2',
>
> -row => '3',
>
> -sticky => 'nesw'
>
> );
>
> $button_9->grid(
>
> -in => $root,
>
> -column => '3',
>
> -row => '3',
>
> -sticky => 'nesw'
>
> );
>
> $button_15->grid(
>
> -in => $root,
>
> -column => '4',
>
> -row => '3',
>
> -columnspan => '2',
>
> -rowspan => '2',
>
> -sticky => 'nesw'
>
> );
>
> $button_10->grid(
>
> -in => $root,
>
> -column => '1',
>
> -row => '4',
>
> -sticky => 'nesw'
>
> );
>
> $button_11->grid(
>
> -in => $root,
>
> -column => '2',
>
> -row => '4',
>
> -sticky => 'nesw'
>
> );
>
> $button_12->grid(
>
> -in => $root,
>
> -column => '3',
>
> -row => '4',
>
> -sticky => 'nesw'
>
> );
>
> # Resize behavior management
>
> # container $root (rows)
>
> $root->gridRowconfigure(1, -weight => 1, -minsize => 70);
>
> $root->gridRowconfigure(2, -weight => 1, -minsize => 70);
>
> $root->gridRowconfigure(3, -weight => 1, -minsize => 70);
>
> $root->gridRowconfigure(4, -weight => 1, -minsize => 70);
>
> # container $root (columns)
>
> $root->gridColumnconfigure(1, -weight => 1, -minsize => 70);
>
> $root->gridColumnconfigure(2, -weight => 1, -minsize => 70);
>
> $root->gridColumnconfigure(3, -weight => 1, -minsize => 70);
>
> $root->gridColumnconfigure(4, -weight => 1, -minsize => 70);
>
> $root->gridColumnconfigure(5, -weight => 1, -minsize => 70);
>
> # additional interface code
>
>
>
> # end additional interface code
>
> }
>
>
>
> okno_ui $main_frame;
>
> ######### to mi wywala błąd!!!!!!!!!!!
>
> #### klawiatura_09_ui $main_frame->panedwindow_1;
>
> Tk::MainLoop;
>
> 1;
>
>
Poradziłem sobie...
1. można wklejać tylko w obietky frame...
2. w sekcji elementu leżącego wyżej:
# additional interface code
# end additional interface code
Dodaje się podrzędny element
klawiatura_09_ui($frame_1);
Technical Details
Message-ID:
<dak68n$srf$1@atlantis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!news.tpi.pl!not-for-mailReferences:
<dajss9$98p$1@nemesis.news.tpi.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!news.tpi.pl!not-for-mail From: "BlackMoon" <chuc@i.dislike.spam.please.remove.it.from.my.email.address.dyktator.com> Newsgroups: pl.comp.lang.perl,pl.comp.lang.tcl Subject: Re: Proszę o pomoc... newbie (jak umieścić widget w innym, albo inaczej- złożyć duży interface z kilku mniejszych) Date: Thu, 7 Jul 2005 23:18:41 +0200 Organization: tp.internet - http://www.tpi.pl/ Lines: 575 Message-ID: <dak68n$srf$1@atlantis.news.tpi.pl> References: <dajss9$98p$1@nemesis.news.tpi.pl> NNTP-Posting-Host: dns.dyktator.com X-Trace: atlantis.news.tpi.pl 1120771161 29551 83.17.100.134 (7 Jul 2005 21:19:21 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Thu, 7 Jul 2005 21:19:21 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Antivirus: avast! (VPS 0527-1, 2005-07-07), Outbound message X-Antivirus-Status: Clean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit