本文整理汇总了C#中Xwt.WithSize方法的典型用法代码示例。如果您正苦于以下问题:C# Xwt.WithSize方法的具体用法?C# Xwt.WithSize怎么用?C# Xwt.WithSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xwt
的用法示例。
在下文中一共展示了Xwt.WithSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StatusIcon
public StatusIcon(StatusArea statusBar, Xwt.Drawing.Image icon)
{
if (!icon.HasFixedSize)
icon = icon.WithSize (IconSize.Menu);
this.statusBar = statusBar;
this.icon = icon;
box = new EventBox ();
box.VisibleWindow = false;
image = new Xwt.ImageView (icon);
box.Child = image.ToGtkWidget ();
box.Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
box.EnterNotifyEvent += HandleEnterNotifyEvent;
box.LeaveNotifyEvent += HandleLeaveNotifyEvent;
}
示例2: StatusIcon
public StatusIcon (StatusArea statusBar, Xwt.Drawing.Image icon)
{
if (!icon.HasFixedSize)
icon = icon.WithSize (IconSize.Menu);
this.statusBar = statusBar;
this.icon = icon;
box = new EventBox ();
box.VisibleWindow = false;
image = new Xwt.ImageView (icon);
box.Child = image.ToGtkWidget ();
box.Events |= Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
box.EnterNotifyEvent += HandleEnterNotifyEvent;
box.LeaveNotifyEvent += HandleLeaveNotifyEvent;
box.ButtonPressEvent += (o, e) => {
// TODO: Refactor this in Xwt as an extension method.
var m = Xwt.ModifierKeys.None;
if ((e.Event.State & Gdk.ModifierType.ShiftMask) != 0)
m |= Xwt.ModifierKeys.Shift;
if ((e.Event.State & Gdk.ModifierType.ControlMask) != 0)
m |= Xwt.ModifierKeys.Control;
if ((e.Event.State & Gdk.ModifierType.Mod1Mask) != 0)
m |= Xwt.ModifierKeys.Alt;
// TODO: Backport this one.
if ((e.Event.State & Gdk.ModifierType.Mod2Mask) != 0)
m |= Xwt.ModifierKeys.Command;
Clicked (o, new StatusBarIconClickedEventArgs {
Button = (Xwt.PointerButton)e.Event.Button,
Modifiers = m,
});
};
}