[Gtk-sharp-list] Glade# Pixmap Resource

Samuel Kaufman emrysk@gmail.com
Sat, 19 Feb 2005 14:16:10 -0800


--=-vkqNZL6Whpg90S8Eci8a
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

For an immediate solution, I'm in favor of a patch where Glade# will
handle GtkImage and GtkToolButton on it's own.  It can remove whatever
is needed to stop the widgets from loading the images while libglade
constructs them, and then, after libglade has done it's magic, Glade#
can throw the embedded resources into them on it's own.  GtkImage and
GtkToolButton seem to the only base Gtk+ widgets that would need to be
changed.  My only concern is that this could, potentially, cause
problems for people who actually want to use an external pixmap of the
same name as an embedded resource.

A long term solution, I'm thinking, would be an addition to the Glade
XML format (plus a tiny Glade designer hack?) and some collaboration
with the libglade guys.

Reimplementing Glade# would certainly score points with me for being
cool, but... well, I'm just too damn lazy.  :-)  Besides, that's duped
code, and the Catch-Up Game would have to be played with libglade all
the time.  libglade is a nice library; I say we use it.  It just needs a
little fixing up.

Glade 3.0 is being hacked away on, from what I hear, and is what
MonoDevelop is going to use.  I'm thinking that makes this a good time
to get a long term solution in for Glade 3.0 and Glade# 2.something.

Any other ideas?

On Sat, 2005-02-19 at 11:29 -0200, Rafael Teixeira wrote:
> I didn't look if glade# mostly wraps libglade. If so I would first
> rewrite glade#, in fully managed code (it seems easy) so to redefine
> the xml to contain new semantics and representations for embedded
> resources. That kind of thing cannot be added in libglade as it is
> CLI-specific. That would put Glade# (we probably would need a new
> name) between what we have in WinForms and the XAML future.
>=20
> The main cost would be to have a new designer for working with the xml
> and embbedding support, but we need it for MonoDevelop and for Windows
> development already.
>=20
> Just some rough ideas...=20
>=20
> The ball is rolling, let's discuss.
>=20
> Fun,
>=20
> On Fri, 18 Feb 2005 19:56:23 -0800, Samuel Kaufman <emrysk@gmail.com> wro=
te:
> > Do you happen to know of other bindings or anything in libglade or Gtk+
> > that deal with embedded resources?  Something I could look at as an
> > example of how similar functionality could be added to Glade#?
> >=20
> > The most straightforward solution that comes to mind would be parsing
> > the XML and stripping out all GtkImages that reference filenames
> > identical to embedded resource filenames, and then having Glade# set th=
e
> > pixbuf, later.  That seems way too complex, though.  There must be a
> > better way.
> >=20
> > On Fri, 2005-02-18 at 15:57 -0200, Rafael Teixeira wrote:
> > > AFAIK, No.
> > >
> > > Normally is a one-liner to do things programatically, but I would lov=
e
> > > to have Glade# extended to deal with embedded resources.
> > >
> > >
> > > On Tue, 15 Feb 2005 22:56:12 +0000, Samuel Kaufman <emrysk@gmail.com>=
 wrote:
> > > > My project has a PNG embedded as a resource in the executable assem=
bly.
> > > > I'm trying to use that PNG on a window in a Glade# project, where
> > > > gui.glade is also a resource in the assembly.  It doesn't look like
> > > > Glade.XML is managing to find the the PNG on it's own.  How can I g=
et it
> > > > to find this pixmap?  Is there a clean way to do it without using c=
ode
> > > > to manually drop the pixmap onto the window?
> > > >  [ snip ]
> > >
> >=20
> >=20
> >=20
>=20
>=20

--=-vkqNZL6Whpg90S8Eci8a
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBCF7qqv1wSpxmNRQkRAkI7AJ9ApOLtCxfXcth7+gwR0+JtT3ibgACdF88u
pqd9p1BAgsLcQTdE1DN9h5c=
=/Wkw
-----END PGP SIGNATURE-----

--=-vkqNZL6Whpg90S8Eci8a--