🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.tcl
Article #93

Proszę o pomoc... newbie (jak umieścić widget w innym, albo inaczej- złożyć duży interface z kilku mniejszych)

#93
From: BlackMoon
Date: Thu, 07 Jul 2005 18:33
546 lines
8173 bytes
 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;
Technical Details
Message-ID: <dajss9$98p$1@nemesis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!tsicnews.teliasonera.com!newsfeed.pionier.net.pl!newsfeed.silweb.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!news.tpi.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!number1.nntp.ams.giganews.com!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!tsicnews.teliasonera.com!newsfeed.pionier.net.pl!newsfeed.silweb.pl!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: 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 20:33:54 +0200
Organization: tp.internet - http://www.tpi.pl/
Lines: 548
Message-ID: <dajss9$98p$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: dns.dyktator.com
X-Trace: nemesis.news.tpi.pl 1120761549 9497 83.17.100.134 (7 Jul 2005 18:39:09 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Thu, 7 Jul 2005 18:39:09 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
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