perl-gtk2

Need help with C, C++, perl, python, etc?

perl-gtk2

Postby shoof » 2007-02-12 21:40

I have a web based app written in Perl that I was trying to migrate to using GTK, I'm using the Gtk2::GladeXML module to generate the gui and it works quite nice.

The app is formated with tables and CSS to position them so I thought I could use Gtk2::Html2 to keep the same layout and colors I have without creating a messy Glade full of labels and tables.

Gtk2::Html2 is kinda new and the documentation is sparse, I've tried to follow the basic example to include a very basic html document into my app but it just doesn't work, no errors. Was hoping somebody else out there has used it and can provide some tips.


This is is the code im using, pretty much the same as the example in the POD.


my $main1 = $gladexml->get_widget('mainWindow1');

# create a new view.
my $view = new Gtk2::Html2::View;
$main1->add($view);

# create and hook up a document
my $document = new Gtk2::Html2::Document;

# tell the view to display this document.
$view->set_document ($document);

my $buf;
open(HTML,"html/main.html");
while (<HTML>) {
$buf .= $_;
}

$document->open_stream ('text/html');
$document->write_stream($buf);
shoof
 
Posts: 379
Joined: 2006-09-08 20:41
Location: My chair

Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable