•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 456,564 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,560 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 999 | Replies: 0
![]() |
•
•
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation:
Rep Power: 2
Solved Threads: 3
Hello all,
I've been having a ton of trouble with this custom gtk dialog I am trying to create. The code "runs" however I receive a GtkWarning message saying:
For the life of me, I can't seem to figure out what going on and why this is happening. As usual, its probably something very simple that keeps passing by me. Heres the code for the dialog.
Help much appreciated.
Thanks!
-Alec Hussey (maddog39)
I've been having a ton of trouble with this custom gtk dialog I am trying to create. The code "runs" however I receive a GtkWarning message saying:
/home/maddog39/Projects/mmoalert/actiondialog.py:42: GtkWarning: gtk_box_pack_end: assertion `child->parent == NULL' failed self.message_hbox.pack_end(self.message_entry)
python Syntax (Toggle Plain Text)
import gtk, utils ACTIONDIALOG_TYPE_ADD = 0 ACTIONDIALOG_TYPE_EDIT = 1 class ActionDialog(gtk.Dialog): def __init__(self, type, app, title=None, content=None): gtk.Dialog.__init__(self, None, None, gtk.DIALOG_MODAL) if type == ACTIONDIALOG_TYPE_ADD: self.set_title("Add New Article") else: self.set_title("Edit Article") # Setup dialog widgets self.title_label = gtk.Label("Title") self.title_entry = gtk.Entry(max=180) self.message_label= gtk.Label("Message") self.message_entry = utils.TextField() self.message_entry.set_wrap_mode(gtk.WRAP_WORD) # Fill fields with data if in edit mode if title != None and content != None: self.title_entry.set_text(title) self.message_entry.set_text(content) # Create boxes to hold widgets self.title_hbox = gtk.HBox() self.title_hbox.pack_start(self.title_label) self.title_hbox.pack_end(self.title_entry) self.message_hbox = gtk.HBox() self.message_hbox.pack_start(self.message_label) self.message_hbox.pack_end(self.message_entry) # DEBUG: not working properly # Pack Widgets into vertical box self.vbox.pack_start(self.title_hbox) self.vbox.pack_start(self.message_hbox) # Add the buttons to the dialog self.add_button(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT) self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)
Thanks!
-Alec Hussey (maddog39)
![]() |
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Some questions about pyGtk, glade and Gnome (Python)
- pygtk Glade GUI freezes (Python)
- Power boot up issue (Motherboards, CPUs and RAM)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
- Memory Issue's! Please Help!! (Motherboards, CPUs and RAM)
- Internet Explorer Connection Issue (Web Browsers)
- Netgear router issue...read this if you have one (Networking Hardware Configuration)
- Internet Explorer Bug lets you run DOS commands remotely (Web Browsers)
Other Threads in the Python Forum
- Previous Thread: _curses... Faulty library module???
- Next Thread: tkinter widgets


Linear Mode