Re: [gtk-list] How do I manualy create a GLArea inside a Glade2Perl created Perl App?



Wayne Keenan wrote:
> 
> As the subject says, plus...
> 
> I have a toplevel window containing a 3x Vbox (menubar, main, status
> bar) which contains a 2x HBox in the 'main' section.
> I am using Glade and creating Perl code via Glade2Perl.
> 
> Could (or should) I go about it by using the 'Custom Widget'?
No, the Custom widget only really makes sense in C. I don't know about
the GLArea but I have embedded a GtkXmHTML like this (use your widget names):

    my $window = new HTML_Window;    # This is just a form with a vbox and
                                     # some buttons that I built in Glade
    $window->TOPLEVEL->set_usize( 600, 650);
    ...
    use Gtk::XmHTML;
    Gtk::XmHTML->init;
    my $html = new Gtk::XmHTML;       # construct the HTML widget
    ...
    $html->signal_connect ("activate", 'toplevel_destroy', $html);
    ...
    $html->show;                                 # to show widget
    $html->source($src);                         # to load the html
    $window->FORM->{'dialog-vbox1'}->add($html); # add widget to the form
    $window->TOPLEVEL->show;                     # show the toplevel form

> 
> As an aside, does anyone know of anybody currently writing a Gtk Book
> with Perl in mind?
There is very little I'm afraid. There is a real need for some Gtk-Perl
documentation but the Gtk+/C docs need very little interpretation for use
with perl (once you have cracked the OO approach that perl uses). 

Someone could really make their name if they produced something like this :)

Regards, Dermot



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]