[Gtk-sharp-list] Gtk.Toolbar.InsertStock() : Help Needed

gtk-sharp@Vitalit.co.uk gtk-sharp@Vitalit.co.uk
Fri, 23 Jul 2004 14:03:08 +0100

Not only do we lose the translations, but dont we also lose any pre-defined
accelerators ?
It also sounds like gtk# is moving away from the way that glade defines a UI
? If so where are we headed in regards to the likes of translation and
platform unity (in my oppinion one of the strengths of gtk is it's
uniformity of UI - makes it easier on the "newbies" like me and makes
standard fuctions and translations easier to implement) ?

I've probably got it all wrong and gtk# is probably only following gtk+ in
terms of functionality, but since C++ is not one of the languages that I am
at all familiar with I cannot tell.

Why do I need to know ? - Hint - I am asking about the creation (in code) of
a related item in a glade xml file - Sounds suspiciously like someone
working on a managed code generating gui designer to me ;-)



----- Original Message ----- 
From: "Fredrik Nilsson" <jymdman@home.se>
To: <Matt@Vitalit.co.uk>
Cc: "gtk-sharp-list" <gtk-sharp-list@lists.ximian.com>
Sent: Friday, July 23, 2004 9:21 AM
Subject: Re: [Gtk-sharp-list] Gtk.Toolbar.InsertStock() : Help Needed

> On fre, 2004-07-23 at 04:24 +0100, wrote:
> > Fredrik, First of all thanks for that info - it's pointing me in the
> > direction I think.
> > I'll be honest and say that I've not tried the InsertStock() method,
> > a little explanation is in order.
> >
> > In order to proceed with a project that I have in mind (dont want to say
> > much just in case I need to scrap it but if I go ahead it will be GPL
:-) )
> > I need a comprehensive understanding of all the standard Gtk widget
> > constructors(especially stock items).  When I saw that InsertStock() was
> > marked as deprecated in the documentation, I made the (probably unsound)
> > assumption that it had already been replaced (logic being that it must
> > been replaced in order for it to be marked as deprecated).  Hence my
> >
> > Since it now looks like InsertStock's replacement does not yet exist, I
> > unsure as to why it is deprecated without a suitable replacement method
> > being ready.  Stock items *seem* to be an such integral part of rapidly
> > building Gtk apps I fail to see the logic.
> >
> > I'm sure there *must* be a logic to it, but coming from an MS.net
> > it escapes me.  Perhaps deprecated doesn't mean "going out of use - use
> > new way" which is what I understood it to be ?
> >
> > The more I think about it - the more sure I become that this is a
> > fundemental error in logic on my part, and any help anyone can give I'd
> > appreciate.
> >
> > Thanks
> >
> > Matt
> > (A "trying hard" to convert C# developer)
> >
> Ok,
> After actually *looking* at the mono docs on the web, my answer differs
> a little :)
> InsertStock seems to be deprecated, as you said, already in gtk# 1.0
> (gtk 2.2) and there is not any replacement.
> The preffered methods, as said in the docs, is to use AppendItem,
> PrependItem and InsertItem.
> So if you want to use a stock button in your toolbar you have to use
> following code:
> Image image = new Image (Stock.Open, IconSize.SmallToolbar);
> toolbar.AppendItem ("Open", "open", "open", image, new SignalFunc
> (open_callback));
> I don't really know how deprecated widgets and methods will be treated
> in gtk#, but gtk+ have a API guarantee for the 2.x release cycle.
> So if you use a method that is deprecated in e.g. 2.2, it should still
> work in 2.8, but probably not 3.0.
> In gtk# 2.0 (gtk+ 2.4) there is going to be a complete new menu and
> toolbar system that is actionbased.
> The menus and toolbars is defined in xml-files and you can easily merge
> two menus or toolbars.
> So if you can wait til october/november for pre-releases, or use the
> jerone-gtk-2-4 branch from cvs, I would use that.
> Hope this clear things up a bit.
> /Fredrik
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list