亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標題: linux下的應用程序嵌入gecko內(nèi)核 [打印本頁]

作者: 雨中漫步    時間: 2006-03-07 09:22
標題: linux下的應用程序嵌入gecko內(nèi)核
mono里有個Gecko.WebControl ClassEmbed a Mozilla browser window into your Gtk# application.
C# Example
[color="blue"]using System;
[color="blue"]using Gtk;
[color="blue"]using Gecko;
[color="blue"]namespace GeckoTest
{
     [color="blue"]class GeckoTest
     {
          WebControl moz;
          Entry entry;
          [color="blue"]string currentUrl;
          Statusbar sb;
          ProgressBar pb;
         
          [color="blue"]static [color="blue"]void Main ([color="blue"]string[] args)
          {
               [color="blue"]new GeckoTest ();
          }
         
          GeckoTest ()
          {
               Application.Init ();
               
               Window win = [color="blue"]new Window ([color="purple"]"GeckoTest");
               win.SetDefaultSize (800, 600);
               win.DeleteEvent += [color="blue"]new DeleteEventHandler (window_delete);
               
               VBox vbox = [color="blue"]new VBox ([color="blue"]false, 1);
               win.Add (vbox);
               
               HBox tb = [color="blue"]new HBox ([color="blue"]true, 1);
               Button btnBack = [color="blue"]new Button (Gtk.Stock.GoBack);
               btnBack.Clicked += [color="blue"]new EventHandler (on_btnBack_clicked);
               Button btnForward = [color="blue"]new Button (Gtk.Stock.GoForward);
               btnForward.Clicked += [color="blue"]new EventHandler (on_btnForward_clicked);
               Button btnStop = [color="blue"]new Button (Gtk.Stock.Stop);
               btnStop.Clicked += [color="blue"]new EventHandler (on_btnStop_clicked);
               Button btnRefresh = [color="blue"]new Button (Gtk.Stock.Refresh);
               btnRefresh.Clicked += [color="blue"]new EventHandler (on_btnRefresh_clicked);
               tb.Add (btnBack);
               tb.Add (btnForward);
               tb.Add (btnStop);
               tb.Add (btnRefresh);
               
               vbox.PackStart (tb, [color="blue"]false, [color="blue"]false, 1);
               
               HBox hbox = [color="blue"]new HBox ([color="blue"]false, 1);
               
               Label label = [color="blue"]new Label ([color="purple"]"Address:");
               
               entry = [color="blue"]new Entry ([color="purple"]"URL");
               entry.Activated += [color="blue"]new EventHandler (entry_activated);
               
               Button button = [color="blue"]new Button ([color="purple"]"GO!");
               button.Clicked += [color="blue"]new EventHandler (button_clicked);
               
               hbox.PackStart (label, [color="blue"]false, [color="blue"]false, 1);
               hbox.PackStart (entry, [color="blue"]true, [color="blue"]true, 1);
               hbox.PackStart (button, [color="blue"]false, [color="blue"]false, 1);
               
               vbox.PackStart (hbox, [color="blue"]false, [color="blue"]false, 1);
               
               moz = [color="blue"]new WebControl ([color="purple"]"/tmp/csharp", [color="purple"]"GeckoTest");
               moz.LinkMsg += [color="blue"]new EventHandler(on_moz_linkmessage);
               vbox.PackStart(moz, [color="blue"]true, [color="blue"]true, 1);
               
               HBox hbox2 = [color="blue"]new HBox ([color="blue"]false, 1);
               vbox.PackStart (hbox2, [color="blue"]false, [color="blue"]false, 1);
               
               sb = [color="blue"]new Statusbar ();
               sb.Push (1, [color="purple"]"Welcome!");
               hbox2.Add (sb);
               
               pb = [color="blue"]new ProgressBar ();
               pb.Orientation = ProgressBarOrientation.LeftToRight;
               hbox2.Add (pb);
               
               win.ShowAll ();
               
               Application.Run ();
          }
         
          [color="blue"]void window_delete ([color="blue"]object obj, DeleteEventArgs args)
          {
               Application.Quit();
          }
         
          [color="blue"]void button_clicked ([color="blue"]object obj, EventArgs args)
          {
               LoadHtml (entry.Text.Trim());
          }
         
          [color="blue"]void on_moz_linkmessage ([color="blue"]object obj, EventArgs args)
          {
               sb.Pop (1);
               sb.Push (1, moz.LinkMessage);
          }
         
          [color="blue"]void entry_activated ([color="blue"]object obj, EventArgs args)
          {
               button_clicked (obj, args);
          }
         
          [color="blue"]void LoadHtml ([color="blue"]string URL)
          {
               moz.LoadUrl (URL);
          }
         
          [color="blue"]void on_btnBack_clicked ([color="blue"]object obj, EventArgs args)
          {
               moz.GoBack();
          }
          [color="blue"]void on_btnStop_clicked ([color="blue"]object obj, EventArgs args)
          {
               moz.StopLoad();
          }
          [color="blue"]void on_btnForward_clicked ([color="blue"]object obj, EventArgs args)
          {
               moz.GoForward();
          }
          [color="blue"]void on_btnRefresh_clicked ([color="blue"]object obj, EventArgs args)
          {
               moz.Reload(0);
          }     
     }
}
Namespace: Gecko
Assembly: gecko-sharp 2.0.0.0 (in gecko-sharp.dll)
               
               
               

本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/809/showart_82002.html
作者: yaolixing    時間: 2017-06-12 18:34
他山界面開發(fā)框架 v22是一套基于Gecko v22 的開源收費跨平臺界面解決方案?墒褂脁ul, html(5), css(3), js 開發(fā)界面,支持js, c++互調(diào),發(fā)行包大小13MB




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2