Цитата(ViGOur @ 22.10.2009, 14:54)
Покажи код, с помощью которого ты это делаешь...
public partial class MainWindow: Gtk.Window
{
double currentZoomValue;
Entry entry;
HTML html;
public MainWindow (): base (Gtk.WindowType.Toplevel)
{
Build ();
html = new HTML ();
ScrollWindow.Add (html);
currentZoomValue = Zoom.Value;
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
void LoadHtml (string URL)
{
string filePath = "/home/user/web/2.html";
HtmlSreamWrite(filePath);
}
void HtmlSreamWrite(string filePath)
{
HTMLStream html_stream;
Stream fileStream = File.Open(filePath, FileMode.Open);
BinaryReader stream = new BinaryReader(fileStream);
byte [] buffer = new byte [8192];
int count;
html_stream = html.Begin ();
while ((count = stream.Read (buffer, 0, 8192)) != 0)
{
html_stream.Write(buffer, count);
}
html.End (html_stream, HTMLStreamStatus.Ok);
fileStream.Close();
}
protected virtual void OnButtonGoClicked (object sender, System.EventArgs e)
{
LoadHtml (string.Empty);
}
protected virtual void OnZoomValueChanged (object sender, System.EventArgs e)
{
if (currentZoomValue > Zoom.Value)
{
html.ZoomOut();
}
else
{
html.ZoomIn();
}
currentZoomValue = Zoom.Value;
}
}