本文整理汇总了C#中Gtk.CheckButton.ModifyBg方法的典型用法代码示例。如果您正苦于以下问题:C# CheckButton.ModifyBg方法的具体用法?C# CheckButton.ModifyBg怎么用?C# CheckButton.ModifyBg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.CheckButton
的用法示例。
在下文中一共展示了CheckButton.ModifyBg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddFeature
Gtk.Widget AddFeature (ISolutionItemFeature feature)
{
Gtk.HBox cbox = new Gtk.HBox ();
CheckButton check = null;
Label fl = new Label ();
fl.Wrap = true;
fl.WidthRequest = 630;
fl.Markup = "<b>" + feature.Title + "</b>\n<small>" + feature.Description + "</small>";
bool enabledByDefault = feature.GetSupportLevel (parentCombine, entry) == FeatureSupportLevel.Enabled;
if (enabledByDefault) {
Alignment al = new Alignment (0,0,0,0);
al.SetPadding (6,6,6,6);
al.Add (fl);
cbox.PackStart (al, false, false, 0);
}
else {
check = new CheckButton ();
check.Image = fl;
cbox.PackStart (check, false, false, 0);
check.ModifyBg (StateType.Prelight, Style.MidColors [(int)StateType.Normal]);
check.BorderWidth = 3;
}
EventBox eb = new EventBox ();
if (!enabledByDefault) {
eb.Realized += delegate {
eb.GdkWindow.Cursor = handCursor;
};
}
eb.ModifyBg (StateType.Normal, Style.MidColors[(int)StateType.Normal]);
eb.Add (cbox);
eb.ShowAll ();
box.PackStart (eb, false, false, 0);
HBox fbox = new HBox ();
Gtk.Widget editor = feature.CreateFeatureEditor (parentCombine, entry);
if (editor != null) {
Label sp = new Label ("");
sp.WidthRequest = 24;
sp.Show ();
fbox.PackStart (sp, false, false, 0);
editor.Show ();
fbox.PackStart (editor, false, false, 0);
box.PackStart (fbox, false, false, 0);
}
if (check != null) {
ISolutionItemFeature f = feature;
check.Toggled += delegate {
OnClickFeature (f, check, fbox, editor);
};
} else {
fbox.Show ();
}
return editor;
}