[Mono-dev] Register my own stock items with Gtk#
Stephane Delcroix
stephane at delcroix.org
Wed Sep 19 10:26:46 EDT 2007
http://svn.gnome.org/viewcvs/f-spot/tags/FSPOT_0_3_5/src/StockIcons.cs?revision=2992&view=markup
that's how it was done in f-spot, but that code is no longer in use.
s
On Wed, 2007-09-19 at 15:52 +0200, David Arnaud-Goddet wrote:
> Ouuuups!
>
> Hi all,
>
> I would like to create my own StockItem with Gtk#.
> In fact I develop a menu with ImageItemMenu and I would like to add my
> own Stock Item in it.
> I have already used those built-in to Gtk# without problem but when I
> try to create StockItem, I just obtain the StockId string!
> I do that :
>
> //Stock Item Print (built-in Gtk#) which works without problem
> group = new AccelGroup ();
> this.AddAccelGroup(group);
> ImageMenuItem print_item = new ImageMenuItem( Stock.Print,
> group);
>
> //Here I try to create my own StockItem
> IconFactory iconFact = new IconFactory();
> IconSource iconSource = new IconSource();
> iconSource.Filename = "myIcone.ico";
> IconSet iconSet = new IconSet();
> iconSet.AddSource(iconSource);
>
> StockItem myStock = new
> StockItem("myStockId","FTP",1,Gdk.ModifierType.ControlMask,"homecare");
> iconFact.Add(myStock.StockId ,iconSet);
>
> Menu menu_send = new Menu();
> ImageMenuItem send_item = new
> ImageMenuItem(myStock.StockId,grup);
> menu_send.Append(send_item);
>
> There is somebody who had already create his own StockItem?
>
> Thanks in advance
>
> --
> David
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
More information about the Mono-devel-list
mailing list