Problems about my newbie code.( using pygtk )

ªü«H asho.bbs at bbs.sayya.org
Mon Jan 20 23:02:28 EST 2003


※ 引述《pedro_rodriguez at club-internet.fr (Pedro Rodriguez)》之銘言:
> an that is why you get a warning message when you run your application :
> Gtk-CRITICAL **: file gtkbin.c: line 217 (gtk_bin_add): assertion `bin->child == NULL'
> failed.
> Usually you add a container widget that manage the layout of sub widgets like a
> GtkVBox.
> from gtk import *
> import os
> def vcdrip(*args):
>         #command = "vcdxrip --cdrom-device=/dev/cdrom -p"
>         command = "hehe"
>         os.system(command)
>         window.destroy()
> def destroy(*args):
>     window.hide()
>     mainquit()
> window = GtkWindow(WINDOW_TOPLEVEL)
> window.connect("destroy", destroy)
> window.set_border_width(50)
> v = GtkVBox()  # added
> window.add(v)  # added
> button = GtkButton("vcdrip")
> button.connect("clicked",vcdrip)
> v.add(button)  # changed
> button.show()
> button2 = GtkButton("exit")
> button2.connect("clicked",destroy)
> v.add(button2) # changed
> button2.show()
> window.show_all()
> mainloop()
> Don't forget there is also a mailing list for pygtk :
> http://www.daa.com.au/mailman/listinfo/pygtk
> Pedro
    Thanks a lot. It did worked...

    I think I should read more about the gtk API reference
--
        ------  阿信  ------
      Welcome To Debian World!!
     Debian GNU/Linux is my love
    一起來摩托學園討論Debian心得
      http://moto.chuany.net/
        SeXyDebian啟動中...
--
※ Origin: SayYA 資訊站 <bbs.sayya.org> 
◆ From: 61-217-64-215.hinet-ip.hinet.net




More information about the Python-list mailing list