5 use FS::UID qw(adminsuidsetup);
7 die "Can't initialize Gtk interface; $FS::UI::Base::_lock used"
8 if $FS::UI::Base::_lock;
9 $FS::UI::Base::_lock = "FS::UI::Gtk";
13 FS::UI::Gtk - Base class for Gtk user-interface objects
18 use FS::UI::some_table;
20 $interface = new FS::UI::some_table;
22 $error = $interface->browse;
23 $error = $interface->search;
24 $error = $interface->view;
25 $error = $interface->edit;
26 $error = $interface->process;
30 An FS::UI::Gtk object represents a Gtk user interface object.
42 my $class = ref($proto) || $proto;
45 bless ( $self, $class );
47 $self->{'_user'} = 'ivan'; #Pop up login window?
48 $self->{'_dbh'} = FS::UID::adminsuidsetup $self->{'_user'};
58 my $vbox = new Gtk::VBox ( 0, 4 );
60 foreach my $widget ( @{ $self->{'Widgets'} } ) {
62 $vbox->pack_start ( $widget->_gtk, 1, 1, 4 );
66 my $window = new Gtk::Window "toplevel";
67 $self->{'_gtk'} = $window;
68 $window->set_title( $self->title );
69 $window->add ( $vbox );
76 Returns the string `Gtk'. Useful for the author of a table-specific UI class
77 to conditionally specify certain behaviour.
81 sub interface { 'Gtk'; }
87 package FS::UI::_Widget;
89 use vars qw( $AUTOLOAD );
93 my $class = ref($proto) || $proto;
95 bless ( $self, $class );
106 my($field)=$AUTOLOAD;
108 if ( defined($value) ) {
109 $self->{$field} = $value;
115 package FS::UI::_Text;
117 use vars qw ( @ISA );
119 @ISA = qw ( FS::UI::_Widget );
123 my $class = ref($proto) || $proto;
125 $self->{'_gtk'} = new Gtk::Label ( shift );
126 bless ( $self, $class );
129 package FS::UI::_Link;
131 use vars qw ( @ISA );
133 @ISA = qw ( FS::UI::_Widget );
137 my $class = ref($proto) || $proto;
139 $self->{'_gtk'} = new_with_label Gtk::Button ( $self->{'text'} );
140 $self->{'_gtk'}->signal_connect( 'clicked', sub {
141 print "STUB: (Gtk) FS::UI::_Link";
143 bless ( $self, $class );
147 package FS::UI::_Table;
149 use vars qw ( @ISA );
151 @ISA = qw ( FS::UI::_Widget );
155 my $class = ref($proto) || $proto;
157 bless ( $self, $class );
159 $self->{'_gtk'} = new Gtk::Table (
170 my ( $row, $column, $widget, $rowspan, $colspan ) = @_;
173 $self->_gtk->attach_defaults(
183 package FS::UI::_Tableborder;
185 use vars qw ( @ISA );
187 @ISA = qw ( FS::UI::_Table );
191 $Id: Gtk.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
195 This documentation is incomplete.
197 _Tableborder is just a _Table now. _Tableborders should scroll (but not the
198 headers) and need and need more decoration. (data in white section ala gtksql
199 and sliding field widths) headers should be buttons that callback to sort on
202 There should be a persistant, per-(freeside)-user store for window positions
203 and sizes and sort fields etc (see L<FS::UI::CGI/BUGS>.
205 Still some small bits of widget code same as FS::UI::CGI.
214 Revision 1.1 1999-08-04 09:03:53 ivan
215 initial checkin of module files for proper perl installation
217 Revision 1.1 1999/01/20 09:30:36 ivan
218 skeletal cross-UI UI code.