[pygtk] gtk.builder__add_from_file() selectivity problem
Bertrand Son Kintanar
b3rxkintanar at gmail.com
Wed Aug 19 06:28:39 WST 2009
On Tue, Aug 18, 2009 at 3:39 PM, nesfree <plavsicp at gmail.com> wrote:
> Hello all,
>
> I am novice in PyGTK/Glade
>
> I have little problem:
>
> Namely, if my glade file contains more Top-level windows I can't separately
> "load" them using
>
> builder = gtk.Builder()
> builder.add_objects_from_file(file.glade)
>
> but I could do that using for example:
>
> self.gladefile = "file.glade"
> self.wTree = gtk.glade.XML(self.gladefile, "mainWindow")
>
> Is there some work-around?
well this is because you dont have to. gtk.builder treats them as objects
now. see below code
#Set the gtk.Builder from xml
self.builder = gtk.Builder()
self.builder.add_from_file(os.path.join(self.local_path, "ui",
"posvrsys.xml"))
#Get the Main Window Object
self.main_window = self.builder.get_object("mainWindow")
#Get the Sub Window Object
self.sub_window = self.builder.get_object("subWindow")
>
>
> Many thanks!
>
I hope it helps
--
b3rx
"Don't be trapped by dogma - which is living with the results of other
people's thinking. - Steve Jobs"
`There are only 10 types of people in the world — those who understand
binary, and those who don't.'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090818/e6ea4020/attachment.htm
More information about the pygtk
mailing list