[Gtk-sharp-list] Problem with Gnome.About
Everaldo Canuto
everaldo_canuto@yahoo.com.br
Thu, 21 Oct 2004 11:54:30 -0300 (ART)
Sergio,
Realy you need to specify full path of image file
because constructor PixBuf(string) need file name not
resource name.
On Gdx.PixBuf documentation theres a contructor:
public Pixbuf (System.Reflection.Assembly assembly,
string resource)
Try to use this constructor... it uses resource name
not a file name.
Everaldo.
--- Sergio Paracuellos <par@dragon-lance.net>
escreveu:
> Hi!
>
> Here you are!
>
> * Call of the About:
>
> private void OnAboutClicked (object o, EventArgs
> args) {
> AboutWindow about = new AboutWindow();
> about.ShowAbout();
> }
>
>
> * AboutWindow.cs
>
> using System;
> using Gtk;
> using Gnome;
>
> namespace gorganizer {
>
> /* About dialog of Gnome class */
> class AboutWindow {
> private Gnome.About about;
> private const string VERSION = "0.1";
>
> //Constructor
> public AboutWindow () {
> Init();
> }
>
> /* init the About dialog from glade file
> */
> private void Init () {
> string [] authors = new string [] {
> "Pablo Gil Torres
> <lakesis@rastafurbi.org>",
> "Guillermo Latorre Zapatero
> <superwillyfoc@rastafurbi.org>",
> "Sergio Paracuellos
> Gutiérrez
> <sergio@rastafurbi.org>",};
> string [] documenters = new string
> [] {
> "Pablo Gil Torres
> <lakesis@rastafurbi.org>",
> "Guillermo Latorre Zapatero
> <superwillyfoc@rastafurbi.org>",
> "Sergio Paracuellos
> Gutiérrez
> <sergio@rastafurbi.org>",};
> Gdk.Pixbuf pixbuf = new
> Gdk.Pixbuf("avispa.png");
> about = new Gnome.About
> ("Gorganizer", VERSION,
>
> "(Copyleft) 2004,
> rastafurbi.org",
> "Free TimeTable Application",
> authors,documenters,null,pixbuf);
> }
>
> /* shows the dialog */
> public void ShowAbout () {
> about.ShowAll();
> }
>
> * Makefile.am:
>
> CSSOURCES = Subject.cs Hours.cs TimeTable.cs
> IMyList.cs SubjectList.cs
> Cell.cs SubjectArea.cs XmlData.cs SelectSubject.cs
> DeleteSubjectWindow.cs DialogObject.cs
> ModifySubjectWindow.cs
> EditSubjectWindow.cs MainWindow.cs AboutWindow.cs
> AddSubjectWindow.cs
> MainTable.cs Gorganizer.cs
>
> REFERECES = -pkg:gtk-sharp -pkg:glade-sharp
> -pkg:gnome-sharp
> -r:Mono.GetOptions
>
> RESOURCES =
> /resource:../glade/MainWindow.glade,MainWindow.glade
> \
>
> /resource:../glade/about.glade,about.glade \
>
> /resource:../glade/addSubject.glade,addSubject.glade
> \
>
>
/resource:../glade/deleteSubject.glade,deleteSubject.glade
> \
>
> /resource:../images/timetable.png,timetable.png \
>
> /resource:../images/avispa.png,avispa.png
>
>
> all: Gorganizer.exe
>
> Gorganizer.exe: $(CSSOURCES)
> mcs $(CSSOURCES) -o $(@) -target:exe
> $(REFERECES) $(RESOURCES)
>
> gorganizerdir = $(prefix)/lib/
> gorganizer_DATA = Gorganizer.exe
>
> bin_SCRIPTS = Gorganizer.exe
>
> CLEANFILES = *.exe Gorganizer.exe
>
>
> El jue, 21-10-2004 a las 11:18 -0300, Everaldo
> Canuto escribió:
> > Hi Sergio,
> >
> > Please send your source code.
> >
> > Everaldo.
> >
> > --- Sergio Paracuellos <par@dragon-lance.net>
> > escreveu:
> > > Hi!
> > >
> > > I'm having problems with Gnome.About widget in
> two
> > > ways:
> > >
> > > 1) When I run the dialog I get the following
> > > warning:
> > >
> > > (<unknown>:8665): Gtk-WARNING **: Invalid input
> > > string
> > >
> > > and I can't see the star and label in "credits"
> > > button.
> > >
> > > 2) I can't set up a image Pixbuf if I don't put
> the
> > > full path, but if I
> > > put a recources section in Makefile like this:
> > >
> > > RESOURCES =
> > >
> /resource:../glade/MainWindow.glade,MainWindow.glade
> > > \
> > >
> > > /resource:../glade/about.glade,about.glade \
> > >
> > >
> /resource:../glade/addSubject.glade,addSubject.glade
> > > \
> > >
> > >
> >
>
/resource:../glade/deleteSubject.glade,deleteSubject.glade
> > > \
> > >
> > > /resource:../images/timetable.png,timetable.png
> \
> > >
> > > /resource:../images/avispa.png,avispa.png
> > >
> > > the name "avispa.png" if I create the Pixbuf
> should
> > > be find in the .exe
> > > file, but it doesn't and the application close
> with
> > > a "no such file or
> > > directory" error.
> > >
> > > Has anybody have any idea of what happends?
> > >
> > > With the other image and .glade files I haven't
> any
> > > problem if I don't
> > > put the full path.
> > >
> > > Thanks!
> > >
> > > Cheers,
> > >
> > > Sergio
> > >
> > >
> >
> > > ATTACHMENT part 2 application/pgp-signature
> > name=signature.asc
> >
> >
> >
> >
> >
> >
> >
>
_______________________________________________________
>
> > Yahoo! Acesso Grátis - Internet rápida e grátis.
> Instale o discador agora!
> http://br.acesso.yahoo.com/
>
=== message truncated ===
> ATTACHMENT part 2 application/pgp-signature
name=signature.asc
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com