🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.tcl
4 messages
4 total messages Started by BlackMoon Thu, 07 Jul 2005 18:33
Proszę o pomoc... newbie (jak umieścić widget w innym, albo inaczej- złożyć duży interface z kilku mniejszych)
#93
Author: 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;
Re: Proszę o pomoc... newbie (jak umieścić widget w innym, albo inaczej- złożyć duży interface z kilku mniejszych)
#100
Author: BlackMoon
Date: Thu, 07 Jul 2005 21:18
571 lines
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);
Re: Proszę o pomoc... newbie (jak umieścić widget w innym, albo inaczej- złożyć duży interface z kilku mniejszych)
#102
Author: Derek Kuliński / takeda
Date: Fri, 08 Jul 2005 09:42
17 lines
2184 bytes
On Thu, 7 Jul 2005 23:18:41 +0200, BlackMoon wrote:

> 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);

I naprawdę musiałeś cytować swoje 548 linii (już pomijając, że poprzedni
post też nie był ok).

-- 
ダレック
takeda@IRCnet.EFnet, ICQ# 15827691, TLEN: taked4, YahooIM: takeda64
http://eggwiki.takeda.tk - nowa ulepszona strona !!!
Re: Prosz? o pomoc... newbie (jak umie?ci? widget w innym, albo inaczej- z?o?y? du?y interface z kilku mniejszych)
#103
Author: BlackMoon
Date: Fri, 08 Jul 2005 14:44
1 lines
1258 bytes
przepraszam. to faktycznie było głupie i nie przemyślane
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads