Question about dialog code

From: Nathan Bullock (nathan_kent_bullock_at_yahoo.ca)
Date: Tue Jan 06 2004 - 23:47:05 EST

  • Next message: Dom Lachowicz: "Re: Question about dialog code"

    Hello again,

    I am still playing around with the print dialog, it
    excepts ranges starting at 0, letters, and other
    strange things, I realize these are small issues but I
    thought it was a good starting point for understanding
    abiword code.

    Okay, so here is the question, the code does something
    like this right after it creates the dialog:

            switch ( abiRunModalDialog ( GTK_DIALOG(window),
    pFrame, this, BUTTON_CANCEL, false ) )
              {
              case BUTTON_PRINT:
                {
                  m_answer = XAP_Dialog_Print::a_OK;
                  break ;
                }
              default:
                {
                  m_answer = XAP_Dialog_Print::a_CANCEL;
                  break;
                }
              }

    I take it that abiRunModalDialog pauses the flow of
    control until the user click on OK or Cancel. This
    works fine, although not at all what I am used to.

    Why don't we have OK and Cancel send events, catch
    those events and close the dialog like that, instead
    of this abiRunModalDialog. Is this the normal way
    things are done in GTK, or is there something special
    being done here that I am missing?

    Anyway as a side note to this, would it be better for
    the OK button to only enable when there is a valid
    range entered (such as my firebird print dialog does)
    or to allow the user to push print and then give an
    error message (like the save as dialog does)?

    Nathan Bullock

    ______________________________________________________________________
    Post your free ad now! http://personals.yahoo.ca



    This archive was generated by hypermail 2.1.4 : Tue Jan 06 2004 - 23:46:30 EST