On 8 Mar 2001, Bill Anderson wrote:

> I've been surfing the archives for the last day and noticed a numbe rof
> libglade related posts. Are they on-topic here? (Yes, I am using Python)

This is a good enough place for pygtk/libglade questions (I am author of
both :)

> 
> If not, pardon the OTness of this post. (and let me know the appropriate
> place, if any) :^)=
> 
> Now on to the questions.
> 
> I hvae a little glade gui-ed app that has a GNOME About box. Whenever I
> run the app, it always starts with the About box dialog open, and with a
> version number of 0.0.
>  o How do I not have it show in the beginning?

In the object properties dialog, uncheck the visible option.  Then you
will have to show() the window before you can see it.

>  o How do I get it to show when the about button is clicked?

In glade, define a handler for the for the clicked signal of the button
(or if it is a menu item, the activate signal).

Then in your python script, do the following:
  def handler(widget, xml):
        about = xml.get_widget('the-name-of-the-about-box')
        about.show()
  xml.signal_connect('what-i-called-the-handler', handler, xml)

>  o How do I set the version?

At your program startup, do the following to import the GNOME libraries:
  import gnome
  gnome.app_version = "version-string"
  import gnome.ui, libglade

(make sure you set app_version before importing gnome.ui).

> 
> 
> Also, are then any examples that deal with getting data frmo entries
> (various types, including the Gnome Druid)? I;ve seen plenty that just
> show how to put something up, but next to nothing that shows actual use,
> even so much as printing the entries.

The usual way is to give the widget you want to manipulate a unique name,
use get_widget() get a reference to the widget, then call its methods.

> 
> Admittedly, at this point I prefer to use libglade in python, and I have
> had less than stellar luck finding docs/examples for that combo. I do
> have access to a site to publish them, and intend to do so as I get
> them.

In gnome-python 1.4.0, there is a small example of libglade use (I
converted over the pygtk/examples/glade/glade.py example from the old
pyglade to libglade).

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to