Ich füge Gtk::Entry
zu Gtk::Dialog
hinzu.Hinzufügen von Gtk :: Eintrag zu Gtk :: Dialog
Gtk::Dialog *dialog = manage (new Gtk::Dialog());
dialog->set_title("Add Text");
Gtk::Entry entry;
entry.set_activates_default(true);
entry.set_max_length(50);
entry.set_text("hello world");
entry.select_region(0, entry.get_text_length());
dialog->add(entry);
dialog->show();
Dieser Code zeigt ein leeres Dialogfeld an. Bei der Verwendung von oder show_all_children()
passiert nichts, nicht einmal ein leeres Dialogfeld wird angezeigt.
Und ich bekomme die folgende Warnung in allen Fällen:
Gtk-WARNING **: Attempting to add a widget with type gtkmm__GtkEntry to a gtkmm__GtkDialog, but as a GtkBin subclass a gtkmm__GtkDialog can only contain one widget at a time; it already contains a widget of type GtkVBox
Hilf mir, dieses Problem zu beheben.