Good day.

I need simple Dialog with two buttons and some fields:

public class ActivationDialog : Dialog
{
    private Entry codeEntry;

    this(Window parent)
    {
        StockID[] buttons = [ StockID.OK, StockID.CANCEL ];
ResponseType[] responses = [ GtkResponseType.OK, GtkResponseType.CANCEL ]; super("Some header", parent, GtkDialogFlags.MODAL, buttons, responses);

        auto box = new Grid;
        box.setColumnHomogeneous(false);
        box.setRowHomogeneous(true);
        box.setRowSpacing(3);
        box.setColumnSpacing(5);
        box.setBorderWidth(8);

        auto label = new Label("Some Text: ");
        box.attach(label, 0, 0, 1, 1);
        label = new Label("shi...@tralala.com");
        box.attach(label, 1, 0, 1, 1);
        label = new Label("Enter number");
        box.attach(label, 0, 1, 1, 1);
        codeEntry = new Entry;
        box.attach(codeEntry, 1, 1, 1, 1);

        getContentArea.packStart(box, true, true, 0);
    }
}

Compiles fine, no warnings, but I see only two buttons. GTK shows no warnings. I replace 'packStart' with add but it no effect too.

 How to add Grid to dialog properly?

Reply via email to