本文整理汇总了C#中Gtk.Widget.ModifyFg方法的典型用法代码示例。如果您正苦于以下问题:C# Widget.ModifyFg方法的具体用法?C# Widget.ModifyFg怎么用?C# Widget.ModifyFg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Widget
的用法示例。
在下文中一共展示了Widget.ModifyFg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertPage
/// <summary>Adds a new page at the specified position.</summary>
/// <param name="Child">The widget to use as the content of the page.</param>
/// <param name="Label">The widget to use as the tab.</param>
/// <param name="Position">The index (starting at 0) at which the page must be inserted, or -1 to insert the page after all existing pages.</param>
public void InsertPage(Widget Child, Widget Label, int Position)
{
RibbonPage p = new RibbonPage (this, Child, Label);
if(Position == -1)
{
pages.Add (p);
}
else
{
pages.Insert (Position, p);
if(curPageIndex != -1)
{
if(Position <= curPageIndex)
++curPageIndex;
}
}
if(pages.Count == 1)
{
CurrentPageIndex = 0;
}
else
{
Label.ModifyFg (StateType.Normal, theme.GetForecolorForRibbonTabs (false));
}
Label.ButtonPressEvent += delegate (object sender, ButtonPressEventArgs evnt)
{
this.SelectRibbonPage (p);
};
Label.EnterNotifyEvent += delegate (object sender, EnterNotifyEventArgs evnt)
{
};
Label.LeaveNotifyEvent += delegate (object sender, LeaveNotifyEventArgs evnt)
{
};
OnPageAdded (new PageEventArgs (p));
for(int idx = Position + 1 ; idx < pages.Count ; ++idx)
{
OnPageSelected (new PageEventArgs (pages[idx]));
}
}