本文整理汇总了C#中Gtk.Window.SetUsize方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetUsize方法的具体用法?C# Window.SetUsize怎么用?C# Window.SetUsize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Window
的用法示例。
在下文中一共展示了Window.SetUsize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnKeyPressEvent
//.........这里部分代码省略.........
if (Evaluate (expr)){
if (expr_copy != input_line){
history.Add (expr_copy);
history_cursor = history.Count;
}
}
history.Add ("");
DumpHistory ();
if (InteractiveBase.QuitRequested && QuitRequested != null)
QuitRequested (this, EventArgs.Empty);
return true;
case Gdk.Key.Up:
if (history_cursor == 0){
DumpHistory ();
return true;
}
string input = InputLine;
if (!String.IsNullOrEmpty (input)){
DumpHistory ();
history [history_cursor] = input;
}
history_cursor--;
InputLine = (string) history [history_cursor];
DumpHistory ();
return true;
case Gdk.Key.Down:
if (history_cursor+1 >= history.Count){
DumpHistory ();
return true;
}
history_cursor++;
InputLine = (string) history [history_cursor];
DumpHistory ();
return true;
case Gdk.Key.Left:
if(Cursor.Compare(InputLineBegin) <= 0) {
return true;
}
break;
case Gdk.Key.Home:
Buffer.MoveMark(Buffer.InsertMark, InputLineBegin);
if((evnt.State & Gdk.ModifierType.ShiftMask) != Gdk.ModifierType.ShiftMask) {
Buffer.MoveMark(Buffer.SelectionBound, InputLineBegin);
}
return true;
case Gdk.Key.Tab:
string saved_text = InputLine;
string prefix;
string [] completions = Evaluator.GetCompletions (LineUntilCursor, out prefix);
if (completions == null)
return true;
if (completions.Length == 1){
TextIter cursor = Cursor;
Buffer.Insert (ref cursor, completions [0]);
return true;
}
Console.WriteLine ();
foreach (var s in completions){
Console.Write (prefix);
Console.Write (s);
Console.Write (" ");
}
// Insert a new line before we evaluate.
end = Buffer.EndIter;
Buffer.InsertWithTagsByName (ref end, "\n", "Stdout");
ShowPrompt (false);
InputLine = saved_text;
#if false
Gtk.TextIter start = Cursor;
if (prefix.Length != 0)
MoveVisually (ref start, -prefix.Length);
int x, y;
GdkWindow.GetOrigin (out x, out y);
var r = GetIterLocation (start);
x += r.X;
y += r.Y;
var w = new Gtk.Window (WindowType.Popup);
w.SetUposition (x, y);
w.SetUsize (100, 100);
foreach (var s in completions){
Console.WriteLine ("{0}[{1}]", prefix, s);
}
w.ShowAll ();
Console.WriteLine ("Position: x={0} y={1}", x + r.X, y +r.Y);
#endif
return true;
default:
break;
}
return base.OnKeyPressEvent(evnt);
}