cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Translate the entire conversation x

Way to tell window_create() to use default window settings?

ehood
10-Marble

Way to tell window_create() to use default window settings?

Product: Arbortext Editor 8.2.2.1

 

I using window_create() to create an 'edit' window to contain a loaded document. If I just call it with the class parameter of 'edit', I end up with a bare-bones window, no menubar, toolbars, etc.  Looking at what is available for the flags parameter, I can find no option to tell  Editor to just give a window like the one that comes up when launching Editor from the Windows Start menu, or via File->Open.

 

Is there a simple way to obtain the appropriate bitmask for window_create() that represents the defaults?

ACCEPTED SOLUTION

Accepted Solutions

The function you're looking for is window_mask(), I think. This returns the flags for an existing window, which you can then apply to a new window. For example, assuming they have a document open when you want to do this, you could use something like this:

function editDoc(doc) {
  local flags = window_mask(current_window());
  local newwin = window_create("edit", flags, doc);
  return newwin;
}
  

If you don't have a window open that you can use to get the mask, you might be better off using the edit command to open the file directly, something like this:

edit -newwindow /path/to/doc.xml

View solution in original post

4 REPLIES 4

Hello @ehood,

Thank you for reaching out with your question
It seems that your inquiry hasn't received any responses yet. To assist you better, I suggest providing more details and context. You might consider including:
 

  1. Steps you have already tried?
  2. Adding details about the environment/constraints?
  3. Reveal any customizations that might be influencing the behavior?
  4. Clarify your expectations?

If possible, adding screenshots can be very helpful for other community members to understand the issue more clearly.
I'm also responding to bring attention to your question. Hopefully, another community member will be able to assist you soon.

Regards,

Vivek N
Community Moderation Team.

 

The question seems fairly basic: What argument to the flags parameter of the window_create function can I use that tells Editor to create window that reflects the user's default settings?  If I do the following:

window_raise(window_create('edit'))

I get an edit window with no toolbars and menus.  Just a bare edit window. If I provide a flags parameter, I have to explicitly specify what the window has, or it will not show.  And when it comes to toolbars, any toolbars not specified in flags is greyed out under View > Toolbars submenu, so the user cannot toggle their visibility after the window is created.

The function you're looking for is window_mask(), I think. This returns the flags for an existing window, which you can then apply to a new window. For example, assuming they have a document open when you want to do this, you could use something like this:

function editDoc(doc) {
  local flags = window_mask(current_window());
  local newwin = window_create("edit", flags, doc);
  return newwin;
}
  

If you don't have a window open that you can use to get the mask, you might be better off using the edit command to open the file directly, something like this:

edit -newwindow /path/to/doc.xml

Yep, I basically went with something similar, where I use window_mask() in a create callback and then use it for windows I create.  IMO, kludgy, but appears there is nothing in the ACL that allows me to create a window with default options.  Somewhere, Arbortext knows how to do it, just not exposed in the ACL.

Announcements

Top Tags