General XMetaL Discussion

  • eamick

    Create toolbars

    Participants 4
    Replies 5
    Last Activity 10 years, 2 months ago

    When exactly can I create a new toolbar from a script? I can't tell which event macro, if any, is appropriate.

    Reply

    Derek Read

    Reply to: Create toolbars

    The event macro provided for making menu and toolbar modifications is On_Default_CommandBars_Complete.

    Reply

    eamick

    Reply to: Create toolbars

    Strange. The online documentation has a note that makes it sound as if you can't create toolbars in that macro. Perhaps that note, which comes after a paragraph that also refers to On_CommandBars_Activate and On_CommandBars_DeActivate,  is referring to On_CommandBars_Activate and On_CommandBars_DeActivate; if so, the note is ambiguous, at least to me.

    Reply

    Derek Read

    Reply to: Create toolbars

    Do you mean this portion?

    The event macro On_Default_CommandBars_Complete is called after the workspace has been loaded and toolbars have been set up. If you want to make modifications to the menus and toolbars, you can do it here; however, you cannot affect the visibility of toolbars from this event. Instead, use the On_CommandBars_Activate or On_CommandBars_DeActivate events.

    Reply

    eamick

    Reply to: Create toolbars

    That's the one. While I think of it, I'm having trouble getting the adding to work properly under Windows Vista with 7.0. When I exit the program, I always get a “program has stopped working” message.

    Reply

    Derek Read

    Reply to: Create toolbars

    What that translates to is this:

    • Use On_Default_CommandBars_Complete to add, remove or change toolbars and menus.
    • Setting the “visible” property for toolbars (on a CommandBarControl or CommandBar object) will have no effect inside the event On_Default_CommandBars_Complete since the toolbars are rendered after this event runs. The only thing happening inside that event is the building up of toolbars and menus before they are rendered.

    In most cases I wouldn't set the Visible property anyway since that is usually something I would leave up to the user to decide.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support