本文整理汇总了C#中Gtk.Image.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Image.Show方法的具体用法?C# Image.Show怎么用?C# Image.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Image
的用法示例。
在下文中一共展示了Image.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tile
public Tile (Hit hit, Query query) : base ()
{
base.AboveChild = true;
base.AppPaintable = true;
base.CanFocus = true;
this.hit = hit;
this.query = query;
this.timestamp = hit.Timestamp;
this.score = hit.Score;
Gtk.Drag.SourceSet (this, Gdk.ModifierType.Button1Mask, targets,
Gdk.DragAction.Copy | Gdk.DragAction.Move);
int pad = (int)StyleGetProperty ("focus-line-width") + (int)StyleGetProperty ("focus-padding") + 1;
hbox = new Gtk.HBox (false, 5);
hbox.BorderWidth = (uint)(pad + Style.Xthickness);
hbox.Show ();
icon = new Gtk.Image ();
icon.Show ();
hbox.PackStart (icon, false, false, 0);
Add (hbox);
}
示例2: PlayPauseButton
public PlayPauseButton(string playXPM, string pauseXPM)
{
_paused = true;
_playImage = new Pixbuf(playXPM);
_pauseImage = new Pixbuf(pauseXPM);
_image = new Gtk.Image();
_image.Pixbuf = _playImage;
Add(_image);
_image.Show();
this.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) {
if (_paused)
_image.Pixbuf = _pauseImage;
else
_image.Pixbuf = _playImage;
_paused = !_paused;
if (Clicked != null)
Clicked(this, new PlayPauseButtonEventArgs(){ IsPaused = _paused });
};
this.WidthRequest = _image.Pixbuf.Width;
}
示例3: ToolBarButton
public ToolBarButton(string image, string label, string tooltip)
: base(null, label)
{
Gtk.Image i = new Gtk.Image ( GetIcon (image));
i.Show ();
this.IconWidget = i;
TooltipText = tooltip;
Show ();
}
示例4: ActionMenuItem
public ActionMenuItem (TileAction action) : base (action.Name)
{
this.action_delegate = action.Action;
if (action.Stock != null) {
Gtk.Image image = new Gtk.Image ();
image.SetFromStock (action.Stock, IconSize.Menu);
image.Show ();
this.Image = image;
}
}
示例5: MainWindow
public MainWindow (): base (Gtk.WindowType.Toplevel)
{
Build ();
radioButtons.Add (this.radTest1);
radioButtons.Add (this.radTest2);
radioButtons.Add (this.radiobutton1);
radioButtons.Add (this.radiobutton2);
string uiaQaPath = UiaAtkBridgeTest.Misc.LookForParentDir ("*.gif");
Gtk.Image img1 = new Gtk.Image ();
img1.File = System.IO.Path.Combine (uiaQaPath, "opensuse60x38.gif");
img1.Show ();
this.btnWithImg.Image = img1;
Gtk.Image img2 = new Gtk.Image ();
img2.File = System.IO.Path.Combine (uiaQaPath, "soccerball.gif");
img2.Show ();
this.checkbutton1.Image = img2;
Gtk.Image img3 = new Gtk.Image ();
img3.File = System.IO.Path.Combine (uiaQaPath, "apple-red.png");
img3.Show ();
this.radTest2.Image = img3;
this.imgTest1.File = System.IO.Path.Combine (uiaQaPath, "goalie.gif");
this.imgTest2.File = System.IO.Path.Combine (uiaQaPath, "apple-red.png");
this.maskedEntry.Visibility = false;
this.hscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue
this.hscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue
this.hscrollbar1.Adjustment.PageSize = 1;
this.hscrollbar1.Adjustment.StepIncrement = 1;
this.vscrollbar1.Adjustment.Lower = 0; //Value tested in AtkTester.InterfaceValue
this.vscrollbar1.Adjustment.Upper = 100; //Value tested in AtkTester.InterfaceValue
this.vscrollbar1.Adjustment.PageSize = 1;
this.vscrollbar1.Adjustment.StepIncrement = 1;
//Used when testing Atk.Action.GetKeybinding
this.btnWithImg.UseUnderline = true;
this.btnTest1.UseUnderline = true;
this.WindowPosition = WindowPosition.CenterAlways;
Gtk.ToolItem item = new Gtk.ToolItem ();
item.Add (new Gtk.Entry ("TEST TEXT"));
this.toolbar1.Insert (item, 3);
this.toolbar1.ShowAll ();
}
示例6: SplashScreenForm
public SplashScreenForm()
: base(Gtk.WindowType.Popup)
{
this.Decorated = false;
this.WindowPosition = WindowPosition.Center;
this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
Gdk.Pixbuf bitmap = new Gdk.Pixbuf(Assembly.GetEntryAssembly(), "lifelets.jpg");
DefaultWidth = bitmap.Width;
DefaultHeight = bitmap.Height;
Gtk.Image image = new Gtk.Image (bitmap);
image.Show ();
this.Add (image);
}
示例7: Append
public void Append (string tip)
{
uint row = table.NRows;
Gtk.Image image = new Gtk.Image (arrow);
image.Show ();
table.Attach (image, 0, 1, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);
Gtk.Label label = new Gtk.Label ();
label.Markup = tip;
label.LineWrap = true;
label.Justify = Justification.Fill;
label.SetAlignment (0.0f, 0.5f);
label.ModifyFg (Gtk.StateType.Normal, label.Style.Foreground (Gtk.StateType.Insensitive));
label.Show ();
table.Attach (label, 1, 2, row, row + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0, 0);
}
示例8: MenuButton
public MenuButton (string label, Menu menu, ArrowType arrow_type) : base ()
{
HBox hbox = new HBox ();
this.image = new Image ();
hbox.PackStart (this.image, false, false, 1);
image.Show ();
this.label = new Label (label);
this.label.Xalign = 0;
hbox.PackStart (this.label, true, true, 1);
this.label.Show ();
this.arrow = new Arrow (arrow_type, ShadowType.None);
hbox.PackStart (arrow, false, false, 1);
arrow.Show ();
Menu = menu;
this.Add (hbox);
hbox.Show ();
}
示例9: MenusToolButton
// base (icon)
public MenusToolButton(Gtk.Menu menu, string icon)
: base(null,null)
{
HBox box = new HBox(false, 0);
box.BorderWidth = 2;
/* Now on to the image stuff */
Gtk.Image image = new Gtk.Image(MainClass.Tools.GetIconFromStock(icon, Gtk.IconSize.SmallToolbar));
Gtk.Arrow arrow = new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.None);
/* Create a label for the button */
Label label = new Label ("label_text");
/* Pack the image and label into the box */
box.PackStart (image, false, false, 3);
box.PackStart(arrow , false, false, 3);
image.Show();
label.Show();
this.IconWidget = box;
this.menu = menu;
//this.Menu = menu;
this.Events = Gdk.EventMask.AllEventsMask;
Child.Events = Gdk.EventMask.AllEventsMask;
this.Clicked+= delegate(object sender, EventArgs e) {
this.menu.Popup (null, null, new Gtk.MenuPositionFunc (OnPosition), 3, Gtk.Global.CurrentEventTime);
};
if (string.IsNullOrEmpty (icon)) {
this.Expand = false;
this.Homogeneous = false;
this.IconWidget = new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.None);
}
}
示例10: SplashScreenForm
public SplashScreenForm()
: base(Gtk.WindowType.Popup)
{
this.Decorated = false;
this.WindowPosition = WindowPosition.Center;
this.TypeHint = Gdk.WindowTypeHint.Splashscreen;
Gdk.Pixbuf bitmap = new Gdk.Pixbuf(Assembly.GetEntryAssembly(), "SplashScreen.png");
Gtk.Image image = new Gtk.Image (bitmap);
image.Show ();
HBox hbox = new HBox();
Alignment align = new Alignment (0.5f, 1.0f, 0.90f, 1.0f);
progress = new ProgressBar();
progress.Fraction = 0.00;
align.Add (progress);
hbox.PackStart (align, true, true, 0);
hbox.ShowAll();
vbox = new VBox();
vbox.PackStart(image, true, true, 0);
vbox.PackStart(hbox, false, true, 5);
this.Add (vbox);
}
示例11: QueryWidget
public QueryWidget(PhotoQuery query, Db db)
: base(new HBox())
{
box = Child as HBox;
box.Spacing = 6;
box.BorderWidth = 2;
tips.Enable ();
this.query = query;
query.Changed += HandleChanged;
label = new Gtk.Label (Catalog.GetString ("Find: "));
label.Show ();
label.Ypad = 9;
box.PackStart (label, false, false, 0);
untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
untagged.Visible = false;
box.PackStart (untagged, false, false, 0);
comma1_label = new Gtk.Label (", ");
comma1_label.Visible = false;
box.PackStart (comma1_label, false, false, 0);
rated = new Gtk.Label (Catalog.GetString ("Rated photos"));
rated.Visible = false;
box.PackStart (rated, false, false, 0);
comma2_label = new Gtk.Label (", ");
comma2_label.Visible = false;
box.PackStart (comma2_label, false, false, 0);
// Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));
rollfilter.Visible = false;
box.PackStart (rollfilter, false, false, 0);
folder_query_widget = new FolderQueryWidget (query);
folder_query_widget.Visible = false;
box.PackStart (folder_query_widget, false, false, 0);
logic_widget = new LogicWidget (query, db.Tags);
logic_widget.Show ();
box.PackStart (logic_widget, true, true, 0);
warning_box = new Gtk.HBox ();
warning_box.PackStart (new Gtk.Label (System.String.Empty));
Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
warning_image.Show ();
warning_box.PackStart (warning_image, false, false, 0);
clear_button = new Gtk.Button ();
clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
clear_button.Clicked += HandleClearButtonClicked;
clear_button.Relief = Gtk.ReliefStyle.None;
box.PackEnd (clear_button, false, false, 0);
tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);
refresh_button = new Gtk.Button ();
refresh_button.Add (new Gtk.Image ("gtk-refresh", Gtk.IconSize.Button));
refresh_button.Clicked += HandleRefreshButtonClicked;
refresh_button.Relief = Gtk.ReliefStyle.None;
box.PackEnd (refresh_button, false, false, 0);
tips.SetTip (refresh_button, Catalog.GetString("Refresh search"), null);
Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
warning_box.PackStart (warning, false, false, 0);
warning_box.ShowAll ();
warning_box.Spacing = 6;
warning_box.Visible = false;
box.PackEnd (warning_box, false, false, 0);
warning_box.Visible = false;
}
示例12: RtmPreferencesWidget
public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences)
: base()
{
if (backend == null)
throw new ArgumentNullException ("backend");
if (preferences == null)
throw new ArgumentNullException ("preferences");
this.backend = backend;
this.preferences = preferences;
LoadPreferences ();
BorderWidth = 0;
// We're using an event box so we can paint the background white
EventBox imageEb = new EventBox ();
imageEb.BorderWidth = 0;
imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
imageEb.Show ();
VBox mainVBox = new VBox(false, 0);
mainVBox.BorderWidth = 10;
mainVBox.Show();
Add(mainVBox);
// Add the rtm logo
image = new Gtk.Image (normalPixbuf);
image.Show();
//make the dialog box look pretty without hard coding total size and
//therefore clipping displays with large fonts.
Alignment spacer = new Alignment((float)0.5, 0, 0, 0);
spacer.SetPadding(0, 0, 125, 125);
spacer.Add(image);
spacer.Show();
imageEb.Add (spacer);
mainVBox.PackStart(imageEb, true, true, 0);
// Status message label
statusLabel = new Label();
statusLabel.Justify = Gtk.Justification.Center;
statusLabel.Wrap = true;
statusLabel.LineWrap = true;
statusLabel.Show();
statusLabel.UseMarkup = true;
statusLabel.UseUnderline = false;
authButton = new LinkButton (
#if GETTEXT
Catalog.GetString ("Click Here to Connect"));
#elif ANDROID
#endif
authButton.Clicked += OnAuthButtonClicked;
if ( isAuthorized ) {
statusLabel.Text = "\n\n" +
#if GETTEXT
Catalog.GetString ("You are currently connected");
#elif ANDROID
#endif
string userName = preferences.Get (PreferencesKeys.UserNameKey);
if (userName != null && userName.Trim () != string.Empty)
statusLabel.Text = "\n\n" +
#if GETTEXT
Catalog.GetString ("You are currently connected as") +
#elif ANDROID
#endif
"\n" + userName.Trim();
} else {
statusLabel.Text = "\n\n" +
#if GETTEXT
Catalog.GetString ("You are not connected");
#elif ANDROID
#endif
authButton.Show();
}
mainVBox.PackStart(statusLabel, false, false, 0);
mainVBox.PackStart(authButton, false, false, 0);
Label blankLabel = new Label("\n");
blankLabel.Show();
mainVBox.PackStart(blankLabel, false, false, 0);
}
示例13: DrawImageInWindow
/// <summary>
/// Placeholder method to draw the existing filename inside the window.
///
/// Currently, we are using a method where we create a new HBox and stuff
/// the image widget there and remove the old widget, which is technically overkill
/// but since this behaves somewhat like a double buffer, it should make the overall
/// experience smoother.
/// </summary>
/// <param name="filename">
/// A <see cref="System.String"/>
/// </param>
void DrawImageInWindow(string filename)
{
// Create the new image widget and draw it being hidden
try {
Log.Debug("Drawing image now");
Gtk.Image drawTarget = new Gtk.Image(filename);
drawTarget.Hide();
foreach(Widget child in hbox3.Children)
{
// remove all existing children
hbox3.Remove(child);
child.Dispose();
}
drawTarget.Show();
hbox3.PackStart(drawTarget, true, true, 0);
} catch (Exception ex) {
Log.Error("Something broke in DrawImageInWindow - " + ex.Message);
}
}
示例14: CreateToolButton
protected virtual ToggleToolButton CreateToolButton()
{
Gtk.Image i2 = new Gtk.Image (PintaCore.Resources.GetIcon (Icon));
i2.Show ();
ToggleToolButton tool_item = new ToggleToolButton ();
tool_item.IconWidget = i2;
tool_item.Show ();
tool_item.Label = Name;
if (ShortcutKey != (Gdk.Key)0)
tool_item.TooltipText = string.Format ("{0}\n{2}: {1}\n\n{3}", Name, ShortcutKey.ToString ().ToUpperInvariant (), Catalog.GetString ("Shortcut key"), StatusBarText);
else
tool_item.TooltipText = Name;
return tool_item;
}
示例15: CommandMapButton
public CommandMapButton(string category_name, Gtk.Action action)
: this(category_name)
{
action.ConnectProxy (this);
TooltipText = action.Label;
Label = action.Label;
Image = new Gtk.Image (action.StockId, IconSize.Button);
ImagePosition = PositionType.Top;
Image.Show ();
}