[Glade-users] RE: Glade and Python. Newbie needs help to access widget and hide windows.


1) You should be able to use the generic documentation for libglade. I know
nothing about PyGTK, but in libglade the function glade_xml_get_widget  will
do what you want. See

2) In libglade you typically make all your top-level windows invisible, and
then manully call gtk_widget_show() when you want to display them. This is
also in the above documentation.

   This is probably a FAQ, but I search the web and could not find any
   information on what I am searching for.  It seams that usage of Glade
   Python is not documented extensively.

   I use PyGTK bindings to access an interface created with Glade 2.0.0.  I
   my application running, but I have the following problem:

   1) How can I access a particular widget.  I have two radio
      buttons named RadioStatusEnabled and RadioStatusDisable.
      They are defined in the xml file, but how do I get their
      value in python?

      In other words, I am looking for something like:

      rdEnabled = ?????.getWidget("RadioStatusEnabled")

      And once I have rdEnabled, how can I find out what functions are
      available? What can I call on that object?  I assume that the
      in python would have the same name as the one in C, but am I right?

   2) In Glade, I created a GtkWindow, a GtkDialog and a GnomeAbout.  When I
      run my program, all 3 windows pop up on the screen.  How can I tell
      python to only show the main GtkWindow on startup?

   Here is the piece of code I am running:

     gnome.init("autopoweroff", "2.0.0")
     xml = gtk.glade.XML('autopoweroff.glade')


Tyson Lloyd Thwaites
Technical Lead
I.T.&e Limited
Level 1, 1 Alexandra Avenue

Phone:  (08) 8111 2800
Fax:       (08) 8331 1735
Email:    tysonlt webmedia com au

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]