RE: XForms: Problems with function generate_menu

From: Þröstur Þorkelsson (Throstur.Thorkelsson@tern.is)
Date: Wed Feb 05 2003 - 13:49:11 EST

  • Next message: Steve Lamont: "RE: XForms: Problems with function generate_menu"

    # To subscribers of the xforms list from =?iso-8859-1?Q?=DEr=F6stur_=DEorkelsson?= <Throstur.Thorkelsson@tern.is> :

    This is my array:

    static FL_PUP_ENTRY fdchoice_0[] =
    {
        { StrReasons[0] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[1] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[2] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[3] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[4] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[5] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[6] , ShowReason, "", FL_PUP_NONE},
        { StrReasons[7] , ShowReason, "", FL_PUP_NONE},
        {0}
    };

    Where StrReasons is the char array holding the labels for the popupmenu and
    ShowReason is the callback which writes into a logfile

    This is where I make the popup menu pushbutton

    fdui->Change = obj = fl_add_button(FL_MENU_BUTTON,120,30,120,20,"Reason for
    Change");
    fl_set_object_callback(obj,cChange,0);
    fl_set_object_lstyle(obj,FL_BOLD_STYLE);

    This is the callback function for the pushbutton

    void cChange(FL_OBJECT *ob, long data){

        pupId = fl_newpup(0);
        fl_setpup_entries(pupId, fdchoice_0);
        fl_dopup(pupId);
    }

    The problem lies in that only every third label comes into the popupmenu
    and on empty
    entry comes in between each written entry ??
    This code worked fine when I used xforms-0.88 compiled for hpux 10.20.

    Thanks in advance

    Þröstur

    -----Original Message-----
    From: Steve Lamont [mailto:spl@ncmir.ucsd.edu]
    Sent: 5. febrúar 2003 18:00
    To: xforms@bob.usuf2.usuhs.mil; xforms@bob.usuhs.mil
    Subject: Re: XForms: Problems with function generate_menu

    # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :

    > . . . My
    > application has a popup menu that has a few entries in it described
    > in FL_PUB_ENTRY structure array. My problem is that only every third
    > item appears in the popup menu and when I want 4 entries to be put
    > in the popup menu the application core dumps and it happens in
    > function generate_menu. . . .

    Example code?

                                                            spl
    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Wed Feb 05 2003 - 13:51:06 EST