To generate menu items at runtime, you have to override QCIndexPort’s initWithNode method. it looks like this:

  • (id)initWithNode:(id)fp8 arguments:(id)fp12;

Here’s some code to do just that:

  • (id)initWithNode:(id)fp8 arguments:(id)fp12 { NSMutableDictionary *config = [fp12 mutableCopy]; NSMutableDictionary *attr; NSMutableArray *menu = [[NSMutableArray alloc] init];

    [config autorelease]; [menu autorelease];

    attr = [config objectForKey:@”attributes”];

    [menu addObject:@”foo”]; [menu addObject:@”bar”]; [menu addObject:@”baz”];

    [attr setValue:menu forKey:@”menu”];

    return [super initWithNode:fp8 arguments:config]; }

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <pre> <div> <span> <b> <i> <br> <table> <tr> <td> <th> <small> <sub> <tex> <equation> <equations> <s>
  • You can enable syntax highlighting of source code with the following tags: [code], [blockcode], [applescript], [bash], [c], [cpp], [css], [diff], [drupal5], [drupal6], [html4], [java], [javascript], [latex], [lisp], [lua], [m68k], [make], [mysql], [objc], [pascal], [perl], [php], [python], [ruby], [sql], [xml].
  • You may insert videos with [video:URL]
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Adds typographic refinements.
  • LaTex commands embedded in text will be interpreted and rendered. Additional information can be found at DruTex Documentation Pages
    • Allowed commands include: \atop \binom \cdot \cfrac \choose \frac \int \ln \over \sum \to
      Allowed environments include: align array equation equations gather matrix split
    • Provides different environments to create rendered images (especially maths).
    • Assists automatic numbering of tex, equation, and equations environments.

    More information about formatting options