本文整理汇总了C#中Gtk.Window类的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Window类的具体用法?C# Gtk.Window怎么用?C# Gtk.Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gtk.Window类属于命名空间,在下文中一共展示了Gtk.Window类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: NativeWindowFrameHasCorrectScreenBounds
public void NativeWindowFrameHasCorrectScreenBounds ()
{
var nativeWindow = new Gtk.Window ("Foo");
nativeWindow.Resize (450, 320);
nativeWindow.Move (13, 50);
nativeWindow.ShowAll ();
WaitForEvents ();
var window = Toolkit.CurrentEngine.WrapWindow (nativeWindow);
var bounds = window.ScreenBounds;
Assert.AreEqual (450, bounds.Width);
Assert.AreEqual (320, bounds.Height);
Assert.AreEqual (13, bounds.X);
Assert.AreEqual (50, bounds.Y);
nativeWindow.Move (30, 100);
WaitForEvents ();
bounds = window.ScreenBounds;
Assert.AreEqual (30, bounds.X);
Assert.AreEqual (100, bounds.Y);
Assert.AreEqual (450, bounds.Width);
Assert.AreEqual (320, bounds.Height);
nativeWindow.Resize (100, 100);
WaitForEvents ();
bounds = window.ScreenBounds;
Assert.AreEqual (30, bounds.X);
Assert.AreEqual (100, bounds.Y);
Assert.AreEqual (100, bounds.Width);
Assert.AreEqual (100, bounds.Height);
}
开发者ID:m13253,项目名称:xwt,代码行数:32,代码来源:GtkIntegrationTests.cs
示例2: ServerListView
public ServerListView(Gtk.Window parent, Glade.XML gladeXml)
{
Trace.Call(parent, gladeXml);
if (parent == null) {
throw new ArgumentNullException("parent");
}
_Parent = parent;
_Controller = new ServerListController(Frontend.UserConfig);
gladeXml.BindFields(this);
_AddButton.Clicked += new EventHandler(OnAddButtonClicked);
_EditButton.Clicked += new EventHandler(OnEditButtonClicked);
_RemoveButton.Clicked += new EventHandler(OnRemoveButtonClicked);
_TreeView.AppendColumn(_("Protocol"), new Gtk.CellRendererText(), "text", 1);
_TreeView.AppendColumn(_("Hostname"), new Gtk.CellRendererText(), "text", 2);
_TreeStore = new Gtk.TreeStore(typeof(ServerModel),
typeof(string), // protocol
typeof(string) // hostname
);
_TreeView.RowActivated += OnTreeViewRowActivated;
_TreeView.Selection.Changed += OnTreeViewSelectionChanged;
_TreeView.Model = _TreeStore;
}
开发者ID:RoninBG,项目名称:smuxi,代码行数:28,代码来源:ServerListView.cs
示例3: CommandManager
public CommandManager(Gtk.Window root)
{
rootWidget = root;
ActionCommand c = new ActionCommand (CommandSystemCommands.ToolbarList, "Toolbar List", null, null, ActionType.Check);
c.CommandArray = true;
RegisterCommand (c, "");
}
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:7,代码来源:CommandManager.cs
示例4: AddressEditor
public AddressEditor(AppConfig config, Gtk.Window parent, Gtk.Container cont, JObject data = null)
{
this.Build ();
this.config = config;
ParentWin = parent;
Cont = cont;
myComboState = new MyCombo (comboState);
myComboMuni = new MyCombo (comboMuni);
myComboAsenta = new MyCombo (comboAsenta);
buttonDelete.ConfirmClick += OnDeleteConfirm;
WidgetPath = Util.GtkGetWidgetPath (this, config);
if (GlobalDefaultStateID == -1)
config.LoadWindowKey (WidgetPath, "default_state_id", out GlobalDefaultStateID);
DefaultStateID = GlobalDefaultStateID;
if (GlobalDefaultMuniID == -1)
config.LoadWindowKey (WidgetPath, "default_muni_id", out GlobalDefaultMuniID);
DefaultMuniID = GlobalDefaultMuniID;
if (GlobalDefaultAsentaID == -1)
config.LoadWindowKey (WidgetPath, "default_asenta_id", out GlobalDefaultAsentaID);
DefaultAsentaID = GlobalDefaultAsentaID;
LoadData (data);
}
开发者ID:pupitetris,项目名称:imr,代码行数:30,代码来源:AddressEditor.cs
示例5: ProgressBarWindow
public ProgressBarWindow(Gtk.Window parent)
: base(Gtk.WindowType.Toplevel)
{
_mainWin = parent;
this.Build ();
this.Shown += delegate { Dialogs.CenterChildToParent(parent,this); };
}
开发者ID:petrj,项目名称:MP3Tagger,代码行数:7,代码来源:ProgressBarWindow.cs
示例6: TestReparenting_ShouldDrawALineInForm
public void TestReparenting_ShouldDrawALineInForm()
{
Gtk.Application.Init();
Form testForm = new Form();
testForm.Show();
Application.DoEvents();
var containerWindow = new Gtk.Window(Gtk.WindowType.Popup);
containerWindow.ShowNow();
containerWindow.Move(-5000, -5000);
while (Gtk.Application.EventsPending()) {
Gtk.Application.RunIteration(false);
}
var gdkWrapperOfForm = Gdk.Window.ForeignNewForDisplay(Gdk.Display.Default, (uint)testForm.Handle);
containerWindow.GdkWindow.Reparent(gdkWrapperOfForm, 0, 0);
Gdk.GC color = containerWindow.Style.DarkGC (Gtk.StateType.Normal);
containerWindow.GdkWindow.DrawLine(color, 0, 0, 100, 100);
while (Gtk.Application.EventsPending()) {
Gtk.Application.RunIteration(false);
}
Application.DoEvents();
}
开发者ID:GTWebSoftware,项目名称:OpenGeckoSharp,代码行数:28,代码来源:Test.cs
示例7: FlagsSelectorDialog
public FlagsSelectorDialog(Gtk.Window parent, EnumDescriptor enumDesc, uint flags, string title)
{
this.flags = flags;
this.parent = parent;
Glade.XML xml = new Glade.XML (null, "stetic.glade", "FlagsSelectorDialog", null);
xml.Autoconnect (this);
store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(uint));
treeView.Model = store;
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle ();
tog.Toggled += new Gtk.ToggledHandler (OnToggled);
col.PackStart (tog, false);
col.AddAttribute (tog, "active", 0);
Gtk.CellRendererText crt = new Gtk.CellRendererText ();
col.PackStart (crt, true);
col.AddAttribute (crt, "text", 1);
treeView.AppendColumn (col);
foreach (Enum value in enumDesc.Values) {
EnumValue eval = enumDesc[value];
if (eval.Label == "")
continue;
uint val = (uint) (int) eval.Value;
store.AppendValues (((flags & val) != 0), eval.Label, val);
}
}
开发者ID:mono,项目名称:stetic,代码行数:32,代码来源:FlagsSelectorDialog.cs
示例8: Dispose
public override void Dispose()
{
base.Dispose();
if(this.Window != null)
{
this.Window.Destroy();
this.Window = null;
}
}
开发者ID:langpavel,项目名称:LPS-old,代码行数:9,代码来源:WindowContext.cs
示例9: WindowOpacityFader
public WindowOpacityFader(Gtk.Window win, double target, double msec)
{
this.win = win;
win.Mapped += HandleMapped;
win.Unmapped += HandleUnmapped;
fadin = new DoubleAnimation (0.0, target, TimeSpan.FromMilliseconds (msec), opacity => {
CompositeUtils.SetWinOpacity (win, opacity);
});
}
开发者ID:Yetangitu,项目名称:f-spot,代码行数:9,代码来源:WindowOpacityFader.cs
示例10: WindowBackend
public WindowBackend()
{
Window = new Gtk.Window ("");
mainBox = new Gtk.VBox ();
Window.Add (mainBox);
mainBox.Show ();
alignment = new Gtk.Alignment (0, 0, 1, 1);
mainBox.PackStart (alignment, true, true, 0);
alignment.Show ();
}
开发者ID:carlosalberto,项目名称:xwt,代码行数:10,代码来源:WindowBackend.cs
示例11: PersistentWindowController
public PersistentWindowController(Gtk.Window window, WindowConfiguration windowConfig, WindowPersistOptions options)
{
this.window = window;
this.options = options;
this.window_config = windowConfig;
window.ConfigureEvent += OnChanged;
window.WindowStateEvent += OnChanged;
window.DestroyEvent += OnDestroy;
}
开发者ID:kelsieflynn,项目名称:banshee,代码行数:10,代码来源:PersistentWindowController.cs
示例12: DateSelectorWindow
public DateSelectorWindow (int x, int y, DateTime defDate, DateEventHandler handler, Gtk.Window parent) : base(Gtk.WindowType.Popup)
{
this.TransientFor = parent;
_parent = parent;
_parent.Modal = false;
this.Modal = true;
this.Build ();
this.Move (x, y);
this.WindowPosition = Gtk.WindowPosition.None;
this.OnChange = handler;
cal.Date = defDate;
}
开发者ID:monsterlabs,项目名称:HumanRightsTracker,代码行数:12,代码来源:DateSelectorWindow.cs
示例13: PhoneEditor
public PhoneEditor(AppConfig config, Gtk.Window parent, Gtk.Container cont, JObject data = null)
{
this.Build ();
this.config = config;
ParentWin = parent;
Cont = cont;
buttonDelete.ConfirmClick += OnDeleteConfirm;
LoadData (data);
}
开发者ID:pupitetris,项目名称:imr,代码行数:12,代码来源:PhoneEditor.cs
示例14: Main
public static void Main(string[] args)
{
GLib.Thread.Init ();
Gtk.Application.Init ();
ColorMaker maker = new ColorMaker ();
Gtk.Window window = new Gtk.Window ("Test");
window.Add (maker);
window.ShowAll ();
Gtk.Application.Run ();
}
开发者ID:jassmith,项目名称:ColorMaker,代码行数:13,代码来源:Main.cs
示例15: Activity
public Activity(Gtk.Window form, string activityId, string bundleId)
{
_activityId=activityId;
_bundleId=bundleId;
_wnd=form;
DBusActivity dbus=new DBusActivity(this);
if (form.IsRealized) {
System.Console.Out.WriteLine("Error, the Window is already Realized so it is possible that the form is not sugarized.");
}
_wnd.Realized += realizeEventHandler;
}
开发者ID:mauroguardarini,项目名称:sugar-sharp,代码行数:13,代码来源:Activity.cs
示例16: CairoPositionSnapshot
public CairoPositionSnapshot(ArrayList pos,
int width, int height)
{
fm = new FigureManager ();
Gtk.Window win =
new Gtk.Window (Gtk.WindowType.
Toplevel);
win.Realize ();
map = new Gdk.Pixmap (win.GdkWindow, width,
height);
cairo = Gdk.CairoHelper.Create (map);
FontDescription fontdesc =
GetFontDesc (width, height);
GetCoordLayoutDetails (win.PangoContext,
fontdesc);
border_color = new Cairo.Color (0, 0, 0);
// blacksq_color = new Gdk.Color (200, 200, 200);
// whitesq_color = new Gdk.Color (240, 240, 240);
blacksq_color =
new Cairo.Color (250 / 256.0,
120 / 256.0,
32 / 256.0);
whitesq_color =
new Cairo.Color (255 / 256.0,
250 / 256.0,
170 / 256.0);
background_color =
new Cairo.Color (1, 1, 1);
foreground_color =
new Cairo.Color (0, 0, 0);
// arrow_color = new Gdk.Color (159, 148, 249);
arrow_color =
new Cairo.Color (117 / 256.0,
6 / 256.0,
6 / 256.0);
// blacksq_color = new Gdk.Color(210, 60, 0);
// whitesq_color = new Gdk.Color(236, 193, 130);
// outer box, coord, inner box
ComputeSizes (width, height);
position = new Position (pos);
fm.SetSize (size);
DrawBackground ();
DrawPosition ();
}
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:50,代码来源:CairoPositionSnapshot.cs
示例17: SendMessagesOverviewWindow
public SendMessagesOverviewWindow()
{
// Create window
Gtk.Window window = new Gtk.Window ( "Verzonden Berichten" );
window.SetSizeRequest (700, 200);
// Add tree to window
Gtk.TreeView tree = new Gtk.TreeView ();
window.Add (tree);
// Create the column for displaying the telephone number.
Gtk.TreeViewColumn numberReceiverColumn = new Gtk.TreeViewColumn ();
numberReceiverColumn.Title = "Telefoon nummer";
numberReceiverColumn.MinWidth = 200;
// Create the text cell that will display the telephone number.
Gtk.CellRendererText numberReceiverCell = new Gtk.CellRendererText ();
// Add the cell to the column.
numberReceiverColumn.PackStart (numberReceiverCell, true);
// Create the column for displaing the message.
Gtk.TreeViewColumn messageColumn = new Gtk.TreeViewColumn ();
messageColumn.Title = "Bericht";
messageColumn.MinWidth = 300;
// Create the text cell that will display the message.
Gtk.CellRendererText messageCell = new Gtk.CellRendererText ();
messageColumn.PackStart (messageCell, true);
// Create the column for displaying the date send.
Gtk.TreeViewColumn sendAtColumn = new Gtk.TreeViewColumn ();
sendAtColumn.Title = "Verstuurd op";
sendAtColumn.MinWidth = 200;
// Create the text cell that will display the date send.
Gtk.CellRendererText sendAtCell = new Gtk.CellRendererText ();
sendAtColumn.PackStart (sendAtCell, true);
tree.AppendColumn (numberReceiverColumn);
tree.AppendColumn (messageColumn);
tree.AppendColumn (sendAtColumn);
// Tell the cell renderers which items in the model to display
numberReceiverColumn.AddAttribute (numberReceiverCell, "text", 0);
messageColumn.AddAttribute (messageCell, "text", 1);
sendAtColumn.AddAttribute (sendAtCell, "text", 2);
// Assign the model to the TreeView
tree.Model = this.getMessageList ();
// Show the window and everythin on it.
window.ShowAll ();
}
开发者ID:jorisrietveld,项目名称:SmsApp,代码行数:49,代码来源:SendMessagesOverviewWindow.cs
示例18: WindowTransparencyDecorator
WindowTransparencyDecorator (Gtk.Window window)
{
this.window = window;
//HACK: Workaround for GTK# crasher bug where GC collects internal wrapper delegates
snoopFunc = TryBindGtkInternals (this);
if (snoopFunc != null) {
window.Shown += ShownHandler;
window.Hidden += HiddenHandler;
window.Destroyed += DestroyedHandler;
} else {
snoopFunc = null;
window = null;
}
}
开发者ID:rdafoe,项目名称:Cage,代码行数:15,代码来源:WindowTransparencyDecorator.cs
示例19: ScanWorks
public ScanWorks(Gtk.Window parent)
{
Images = new List<Pixbuf>();
_parent = parent;
if(Environment.OSVersion.Platform == PlatformID.Win32NT)
{
WorkWithTwain = true;
SetupTwain();
}
else
{
WorkWithTwain = false;
//FIXME Setup Linux scanner
}
}
开发者ID:Badou03080,项目名称:earchive,代码行数:16,代码来源:ScanWorks.cs
示例20: PositionSnapshot
public PositionSnapshot(ArrayList pos, int width,
int height)
{
Gtk.Window win =
new Gtk.Window (Gtk.WindowType.
Toplevel);
win.Realize ();
map = new Gdk.Pixmap (win.GdkWindow, width,
height);
gc = new Gdk.GC (map);
FontDescription fontdesc =
GetFontDesc (width, height);
GetCoordLayoutDetails (win.PangoContext,
fontdesc);
border_color = new Gdk.Color (0, 0, 0);
// blacksq_color = new Gdk.Color (200, 200, 200);
// whitesq_color = new Gdk.Color (240, 240, 240);
blacksq_color =
new Gdk.Color (250, 120, 32);
whitesq_color =
new Gdk.Color (255, 250, 170);
background_color =
new Gdk.Color (255, 255, 255);
foreground_color = new Gdk.Color (0, 0, 0);
// arrow_color = new Gdk.Color (159, 148, 249);
arrow_color = new Gdk.Color (117, 6, 6);
// blacksq_color = new Gdk.Color(210, 60, 0);
// whitesq_color = new Gdk.Color(236, 193, 130);
// outer box, coord, inner box
ComputeSizes (width, height);
if (figure == null)
figure = new Figure ();
position = new Position (pos);
figure.SetSize (size);
DrawBackground ();
DrawPosition ();
}
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:43,代码来源:PositionSnapshot.cs
注:本文中的Gtk.Window类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论