Glade-Perl

 view release on metacpan or  search on metacpan

Glade/PerlUIGtk.pm  view on Meta::CPAN

    my $me = "$class->new_GtkCalendar";
    my $name = $proto->{'name'};
    my @options;
    push @options, 'show_heading'       if 
        $class->use_par($proto, 'show_heading',      $BOOL, 'False' );
    push @options, 'show_day_names'     if 
        $class->use_par($proto, 'show_day_names',    $BOOL, 'False' );
    push @options, 'no_month_change'    if 
        $class->use_par($proto, 'no_month_change',   $BOOL, 'False' );
    push @options, 'show_week_numbers'  if 
        $class->use_par($proto, 'show_week_numbers', $BOOL, 'False' );
    push @options, 'week_start_monday'  if 
        $class->use_par($proto, 'week_start_monday', $BOOL, 'False' );
    my $display_options;
    if (scalar @options) {
        $display_options = "['".join("', '", @options)."']"
    } else {
        $display_options = '[]'
    }

    $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::Calendar;" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->display_options(".
        "$display_options );" );
    $class->add_to_UI( $depth, "\$work->{'$name-date'} = [localtime];");
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->select_day(".
        "\$work->{'$name-date'}[3] );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->select_month(".
        "\$work->{'$name-date'}[4], \$work->{'$name-date'}[5] + 1900);" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkCheckButton {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkCheckButton";
    my $name = $proto->{'name'};
    my $label   = $class->use_par($proto, 'label',  $DEFAULT, '' );
    my $draw_indicator = $class->use_par($proto, 'draw_indicator', $BOOL, 'False' );
    my $active  = $class->use_par($proto, 'active', $BOOL,    'False' );

    $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::CheckButton(".
        "_('$label'));" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_mode($draw_indicator );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_state($active );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    if (_($label) =~ /_/) {
        $class->add_to_UI( $depth,
            "$current_form\{'$name-key'} = ".
                "$current_form\{'$name'}->child->parse_uline(_('$label') );");
        $class->add_to_UI( $depth,
            "$current_form\{'$name'}->add_accelerator(".
                "'clicked', $current_form\{'accelgroup'}, ". 
                "$current_form\{'$name-key'}, 'mod1_mask', ['visible', 'locked'] );");
        undef $widgets->{"$name-key"};
    }
    return $widgets->{$name};
}

sub new_GtkCheckMenuItem {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkCheckMenuItem";
    my $name = $proto->{'name'};
    my $label  = $class->use_par($proto, 'label',  $DEFAULT, '' );
    my $active = $class->use_par($proto, 'active', $BOOL,    'False' );
    my $always_show_toggle= $class->use_par($proto, 'always_show_toggle', $BOOL, 'False' );

    $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
        "new_with_label Gtk::CheckMenuItem(_('$label'));" );

    if ($class->use_par($proto, 'right_justify',    $BOOL, 'False' )) {
        $class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
    }
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_state($active );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_show_toggle($always_show_toggle );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    if (_($label) =~ /_/) {
        $class->add_to_UI( $depth,
            "$current_form\{'$name-key'} = ".
                "$current_form\{'$name'}->child->parse_uline(_('$label') );");
        $class->add_to_UI( $depth,
            "$current_form\{'$name'}->add_accelerator(".
                "'activate', $current_form\{'accelgroup'}, ". 
                "$current_form\{'$name-key'}, 'mod1_mask', ['visible', 'locked'] );");
        undef $widgets->{"$name-key"};
    }
    return $widgets->{$name};
}


sub new_GtkCList {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkCList";
    my $name = $proto->{'name'};
    my $columns        = $class->use_par($proto, 'columns' );
    my $selection_mode = $class->use_par($proto, 'selection_mode', $LOOKUP );
    my $shadow_type    = $class->use_par($proto, 'shadow_type',    $LOOKUP );

    $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::CList(".
        "$columns );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_selection_mode(".
        "'$selection_mode' );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_border(".
        "'$shadow_type' );" );
    if ($class->use_par($proto, 'show_titles', $BOOL, 'True' )) {
        $class->add_to_UI( $depth,  "\$widgets->{'$name'}->column_titles_show;" );
    }
    my @column_widths     = split(',', $class->use_par($proto, 'column_widths' ));
    $CList_column = 0;
    my $i = 0;
    while ($i < scalar(@column_widths)) { 
        $Glade_Perl->diag_print(8, 
            "%s- Setting column %s to width %s in %s",
            $indent, $i, $column_widths[$i], $me);
        $class->add_to_UI( $depth,  "\$widgets->{'$name'}->set_column_width(".
            "$i, $column_widths[$i] );" );
        $i++;
    }

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkCTree {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkCTree";
    my $name = $proto->{'name'};
    my $columns        = $class->use_par($proto, 'columns' );

Glade/PerlUIGtk.pm  view on Meta::CPAN

sub new_GtkLabel {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkLabel";
    my $name = $proto->{'name'};
    my $label   = $class->use_par($proto, 'label',   $DEFAULT, '' );
    my $justify = $class->use_par($proto, 'justify', $LOOKUP,  'center' );
    my $wrap    = $class->use_par($proto, 'wrap', $BOOL, 'False' );

    if ($label =~ /_/) {
        $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::Label('');" );
        $class->add_to_UI( $depth, "\$widgets->{'$name'}->parse_uline(".
            "_('$label') );" );
    } else {
        $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::Label(".
            "_('$label'));" );
    }
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_justify('$justify' );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_line_wrap($wrap );" );

    $class->pack_widget($parent, $name, $proto, $depth);
    $class->set_misc_properties($parent, $name, $proto, $depth);
    return $widgets->{$name};
}

sub new_GtkLayout {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkLayout";
    my $name = $proto->{'name'};
    my $hstep = $class->use_par($proto, 'hstep', $DEFAULT, 10 );
    my $vstep = $class->use_par($proto, 'vstep', $DEFAULT, 10 );
    my $area_width  = $class->use_par($proto, 'area_width',  $DEFAULT, 0 );
    my $area_height = $class->use_par($proto, 'area_height',  $DEFAULT, 0 );
    
    $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Layout(".
        "undef, undef );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_size(".
        "$area_width, $area_height );" );
    $class->add_to_UI( $depth, 
        "\$widgets->{'$name'}->get_hadjustment->step_increment($hstep );" );
    $class->add_to_UI( $depth, 
        "\$widgets->{'$name'}->get_vadjustment->step_increment($vstep );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkList {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkList";
    my $name = $proto->{'name'};
    my $selection_mode = $class->use_par($proto, 'selection_mode', $LOOKUP, 'single' );

    $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::List;" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_selection_mode(".
        "'$selection_mode' );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkMenu {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkMenu";
    my $name = $proto->{'name'};

    $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Menu;" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkMenuBar {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkMenuBar";
    my $name = $proto->{'name'};
    my $shadow_type = $class->use_par($proto, 'shadow_type', $LOOKUP, 'out' );

    $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuBar;" );
    $shadow_type &&
        $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_shadow_type(".
            "'$shadow_type' );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkMenuFactory {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkMenuFactory";
    my $name = $proto->{'name'};

    $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuFactory("." );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkMenuItem {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkMenuItem";
    my $name = $proto->{'name'};
    my $label = $class->use_par($proto, 'label', $DEFAULT, '' );
    my $right_justify = $class->use_par($proto, 'right_justify', $BOOL, 'False' );

    if ($proto->{'stock_item'}) {
# FIXME - this is a Gnome stock menu item and should be in UIExtra
# FIXME convert this to do a proper lookup (maybe with new sub)
        my $stock_item = $class->use_par($proto, 'stock_item', $DEFAULT, '' );
        $stock_item =~ s/GNOMEUIINFO_MENU_(.*)_TREE/$1/;
# FIXME this creates the string - we should look it up instead
        $stock_item = ucfirst(lc($stock_item));
# FIXME this only does uline for first character wrong, wrong, wrong
        $label = "_".$stock_item;
#        $stock_item = $Glade::PerlUIExtra::gnome_enums->{"GNOME_STOCK_PIXMAP_$stock_item"};
#        $class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
#            "Gnome::Stock->menu_item('$stock_item', '$stock_item');" );
    } 
    if ($label) {
        $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuItem(".
            "_('$label'));" );
    } else {
        $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::MenuItem;" );
    }
    if ($right_justify) { 
        $class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
    }
    $class->pack_widget($parent, $name, $proto, $depth );
    if (_($label) =~ /_/) {
        $class->add_to_UI( $depth,
            "$current_form\{'$name-key'} = ".
                "$current_form\{'$name'}->child->parse_uline(_('$label') );");
        $class->add_to_UI( $depth,
            "$current_form\{'$name'}->add_accelerator(".
                "'activate_item', $current_form\{'accelgroup'}, ". 
                "$current_form\{'$name-key'}, 'mod1_mask', ['visible', 'locked'] );");
        undef $widgets->{"$name-key"};
    }
    return $widgets->{$name};
}

sub new_GtkNotebook {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkNotebook";
    my $name = $proto->{'name'};
    my $tab_pos     = $class->use_par($proto, 'tab_pos'    , $LOOKUP, 'top' );
    my $show_tabs   = $class->use_par($proto, 'show_tabs',   $BOOL,   'True' );
    my $show_border = $class->use_par($proto, 'show_border', $BOOL,   'True' );
    my $scrollable  = $class->use_par($proto, 'scrollable',  $BOOL,   'True' );
    my $tab_hborder = $class->use_par($proto, 'tab_hborder', $DEFAULT, 0 );
    my $tab_vborder = $class->use_par($proto, 'tab_vborder', $DEFAULT, 0 );
    my $ignore      = $class->use_par($proto, 'num_pages',   $DEFAULT, 0 );
    
    unless ($class->new_from_child_name($parent, $name, $proto, $depth )) {
        $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Notebook;" );
        $class->pack_widget($parent, $name, $proto, $depth );
    }
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_tab_pos('$tab_pos' );" );
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_show_tabs($show_tabs );" );
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_show_border($show_border );" );
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_scrollable($scrollable );" );
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_tab_hborder($tab_hborder );" );
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_tab_vborder($tab_vborder );" );
    if ($class->use_par($proto, 'popup_enable',    $BOOL,    'True'    )) { 
        $class->add_to_UI( $depth,  "$current_form\{'$name'}->popup_enable;" );
    }
    # 'num_pages'
    $nb->{$name} = {'panes' => [], 'pane' => 0, 'tab' => 0};
    @Notebook_panes = ();
    $Notebook_pane = 0;
    $Notebook_tab = 0;

    return $widgets->{$name};
}

sub new_GtkObject {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkObject";
    my $name = $proto->{'name'};

    $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Object;" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkOptionMenu {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkOptionMenu";
    my $name = $proto->{'name'};
    my $item;
    my @items;
    my $count = 0;
    my $items          = $class->use_par($proto, 'items' );
    my $initial_choice = $class->use_par($proto, 'initial_choice', $DEFAULT, 0 );

    $class->add_to_UI( $depth,  "\$widgets->{'$name'} = new Gtk::OptionMenu;" );
    $class->pack_widget($parent, $name, $proto, $depth );

    $class->add_to_UI( $depth,  "\$widgets->{'${name}_menu'} = new Gtk::Menu;" );
    $class->pack_widget("$name", "${name}_menu", $proto, $depth );
    if (defined $items) {
        @items = split(/\n/, $items );
        foreach $item (@items) {
            if ($item) {
                $class->add_to_UI( $depth,  "\$widgets->{'${name}_item$count'} = ".
                    "new Gtk::MenuItem('$item' );" );
                $class->pack_widget("${name}_menu", "${name}_item$count", $proto, $depth+1 );
                if ($count == $initial_choice) {
                    $class->add_to_UI( $depth, 
                        "${current_form}\{'${name}_item$count'}\->activate;" );
                }
                $count++;
            }
        }
        $class->add_to_UI( $depth, 
            "${current_form}\{'$name'}->set_history( $initial_choice );" );
    }
    return $widgets->{$name};
}

sub new_GtkPacker {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkPacker";
    my $name = $proto->{'name'};
    my $default_border_width = $class->use_par($proto, 'default_border_width', $DEFAULT, 0 );
    my $default_ipad_x = $class->use_par($proto, 'default_ipad_x', $DEFAULT, 0 );
    my $default_ipad_y = $class->use_par($proto, 'default_ipad_y', $DEFAULT, 0 );
    my $default_pad_x  = $class->use_par($proto, 'default_pad_x',  $DEFAULT, 0 );
    my $default_pad_y  = $class->use_par($proto, 'default_pad_y',  $DEFAULT, 0 );
    my $use_default    = $class->use_par($proto, 'use_default',    $BOOL,    'True' );

    $class->add_to_UI($depth, "\$widgets->{'$name'} = new Gtk::Packer;" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_default_border_width(".
        "$default_border_width );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_default_pad(".
        "$default_pad_x, $default_pad_y );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_default_ipad(".
        "$default_ipad_x, $default_ipad_y );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkPixmap {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkPixmap";
    my $name = $proto->{'name'};
    my $filename = $class->use_par($proto, 'filename', $DEFAULT, '' );
    my $build_insensitive = $class->use_par($proto, 'build_insensitive', $BOOL, 'False' );
    unless ($filename) {
        $Glade_Perl->diag_print(2, "warn  No pixmap file specified for GtkPixmap ".
            "'%s' so we are using the project logo instead", $name);
        $filename = $Glade_Perl->app->logo;
    }
    $filename = "\"\$Glade::PerlRun::pixmaps_directory/$filename\"";
    $class->add_to_UI( $depth, "\$widgets->{'$name'} = ".
        "\$class->create_pixmap($current_window, $filename );" );
    unless ($Glade_Perl->source->quick_gen or defined $widgets->{$name}) { 
        die sprintf(("\nerror %s failed to create pixmap from file '%s'"),
            $me, $filename), "\n";
    }
    unless ($build_insensitive) {
        $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_build_insensitive(".
            "$build_insensitive );" );
    }
    

Glade/PerlUIGtk.pm  view on Meta::CPAN

    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_activity_mode(".
        "$activity_mode );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_text_alignment(".
        "$text_xalign, $text_yalign );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_format_string(".
        "_('$format' ));" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->configure(".
        "$value, $lower, $upper );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkRadioButton {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkRadioButton";
    my $name = $proto->{'name'};
    my $label  = $class->use_par($proto, 'label'    ,  $DEFAULT, '' );
    my $draw_indicator = $class->use_par($proto, 'draw_indicator', $BOOL, 'False' );
    my $active = $class->use_par($proto, 'active',     $BOOL,    'False' );

    unless ($class->new_from_child_name($parent, $name, $proto, $depth )) {
        my $group  = $class->use_par($proto, 'group'    ,  $DEFAULT, '' );
        my $rb_group = "$current_form\{'rb-group-$group'}";

        if ($group) {
            if (eval "defined $rb_group") {
                $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
                    "new Gtk::RadioButton(_('$label'), $rb_group );" );
            } else {
                $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
                    "new Gtk::RadioButton(_('$label') );" );
                $class->add_to_UI( $depth,  "$rb_group = \$widgets->{'$name'};" );

            }
        } else {
            $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
                "new Gtk::RadioButton(_('$label') );" );
        }
        $class->pack_widget($parent, $name, $proto, $depth );
        if (_($label) =~ /_/) {
            $class->add_to_UI( $depth,
                "$current_form\{'$name-key'} = ".
                    "$current_form\{'$name'}->child->parse_uline(_('$label') );");
            $class->add_to_UI( $depth,
                "$current_form\{'$name'}->add_accelerator(".
                    "'clicked', $current_form\{'accelgroup'}, ". 
                    "$current_form\{'$name-key'}, 'mod1_mask', ['visible', 'locked'] );");
            undef $widgets->{"$name-key"};
        }
    }
    
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_mode(".
        "$draw_indicator );" );
    $class->add_to_UI( $depth, "$current_form\{'$name'}->set_state(".
        "$active );" );

    return $widgets->{$name};
}

sub new_GtkRadioMenuItem {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkRadioMenuItem";
    my $name = $proto->{'name'};
    my $label  = $class->use_par($proto, 'label',  $DEFAULT, '' );
    my $right_justify = $class->use_par($proto, 'right_justify', $BOOL, 'False' );
    my $active = $class->use_par($proto, 'active', $BOOL,    'False' );
    my $always_show_toggle = $class->use_par($proto, 'always_show_toggle', $BOOL, 'True' );
    my $group  = $class->use_par($proto, 'group',  $DEFAULT, '' );
    my $rmi_group = "$current_form\{'rmi-group-$group'}";

    if ($group) {
        if (eval "defined $rmi_group") {
            $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
                "new Gtk::RadioMenuItem(_('$label'), $rmi_group );" );
        } else {
            $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
                "new Gtk::RadioMenuItem(_('$label') );" );
        }
        $class->add_to_UI( $depth,  "$rmi_group = \$widgets->{'$name'};" );
    } else {
        $class->add_to_UI( $depth,  "\$widgets->{'$name'} = ".
            "new Gtk::RadioMenuItem(_('$label') );" );
    }

    if ($right_justify) {
        $class->add_to_UI( $depth, "\$widgets->{'$name'}->right_justify;" );
    }
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_state(".
        "$active );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_show_toggle(".
        "$always_show_toggle );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    if (_($label) =~ /_/) {
        $class->add_to_UI( $depth,
            "$current_form\{'$name-key'} = ".
                "$current_form\{'$name'}->child->parse_uline(_('$label') );");
        $class->add_to_UI( $depth,
            "$current_form\{'$name'}->add_accelerator(".
                "'activate', $current_form\{'accelgroup'}, ". 
                "$current_form\{'$name-key'}, 'mod1_mask', ['visible', 'locked'] );");
        undef $widgets->{"$name-key"};
    }
    return $widgets->{$name};
}

sub new_GtkScrolledWindow {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkScrolledWindow";
    my $name = $proto->{'name'};
    my $hscrollbar_policy = $class->use_par($proto, 'hscrollbar_policy', $LOOKUP, 'always' );
    my $vscrollbar_policy = $class->use_par($proto, 'vscrollbar_policy', $LOOKUP, 'always' );
    my $border_width      = $class->use_par($proto, 'border_width',      $DEFAULT,    0 );
    my $hupdate_policy    = $class->use_par($proto, 'hupdate_policy',    $LOOKUP, 'continuous' );
    my $vupdate_policy    = $class->use_par($proto, 'vupdate_policy',    $LOOKUP, 'continuous' );

    $class->add_to_UI( $depth,  
        "\$widgets->{'$name'} = new Gtk::ScrolledWindow( undef, undef);" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->set_policy(".
        "'$hscrollbar_policy', '$vscrollbar_policy' );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->border_width(".
        "$border_width );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->hscrollbar->".
        "set_update_policy('$hupdate_policy' );" );
    $class->add_to_UI( $depth, "\$widgets->{'$name'}->vscrollbar->".
        "set_update_policy('$vupdate_policy' );" );

    $class->pack_widget($parent, $name, $proto, $depth );
    return $widgets->{$name};
}

sub new_GtkSpinButton {
    my ($class, $parent, $proto, $depth) = @_;
    my $me = "$class->new_GtkSpinButton";
    my $name = $proto->{'name'};
    my $pre = '';
    $pre = 'h' if $proto->{'hlower'}; # cater for Glade <= 0.5.1
    my $lower     = $class->use_par($proto, $pre.'lower',     $DEFAULT, 0 );
    my $upper     = $class->use_par($proto, $pre.'upper',     $DEFAULT, 100 );
    my $step      = $class->use_par($proto, $pre.'step',      $DEFAULT, 1 );
    my $page      = $class->use_par($proto, $pre.'page',      $DEFAULT, 10 );
    my $page_size = $class->use_par($proto, $pre.'page_size', $DEFAULT, 10 );



( run in 1.511 second using v1.01-cache-2.11-cpan-99c4e6809bf )