<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I've wondered about this feature myself.  My temporary solution was
    to write a plugin that hides the menu bar until mouse over, like the
    Start bar used to be configurable in Windows.  I haven't had a
    chance to update all of my plugins to the latest geany, but if you
    care to look at the plugin, you can see it <a
href="https://github.com/sblatnick/geany-plugins/blob/master/hide-menu/src/hide-menu.c">here</a>.<br>
    <br>
    Alternatively, I thought the best idea would be a single icon, like
    chrome's menu icon.  The problem is finding a place for it that
    doesn't occupy an entire row or column of screen space.<br>
    <br>
    Thanks,<br>
    <br>
    Steve<br>
    <br>
    <div class="moz-cite-prefix">On 07/04/2016 10:23 AM, Colomban
      Wendling wrote:<br>
    </div>
    <blockquote
      cite="mid:bc72eb24-228e-8cfd-9530-0bc79da293d5@herbesfolles.org"
      type="cite">
      <pre wrap="">Le 02/07/2016 à 11:08, Vasiliy Faronov a écrit :
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi,

Most of the time, when using Geany, I don't need the menu and status
bars; they are just noise. But occasionally I want to check the status
bar (e.g. for the line/column number) or browse the menu. So I want to
toggle their visibility with a keystroke.

I wrote a simple plugin for that: <a class="moz-txt-link-freetext" href="https://github.com/vfaronov/geany-togglebars">https://github.com/vfaronov/geany-togglebars</a>

The problem is, the menu and status bars are not exposed in
geany.main_widgets, so I have to find them manually, which makes the
plugin brittle as it relies on a specific window layout.

Perhaps there is a better way to do it?
</pre>
      </blockquote>
      <pre wrap="">
You could use a more solid resolve_widget() function, that doesn't rely
on the layout, something like that:

</pre>
      <blockquote type="cite">
        <pre wrap="">def resolve_widget(widget, expected_type):
    if isinstance(widget, expected_type):
        return widget
    elif isinstance(widget, Gtk.Container):
        for child in widget.get_children():
            ret = resolve_widget(child, expected_type)
            if ret:
                return ret
    return None
</pre>
      </blockquote>
      <pre wrap="">
Also, your plugin is a bit dangerous for the new user if I read it
correctly: you do not bind the keybinding by default (which is good),
but you hide the menubar by default.  This means that the user enabling
your plugin might be totally lost with no way of recovering his/her
menubar to even access the preferences and set a keybinding.

I guess you did that because you didn't wanna bother about a
configuration file for saving the state for such a little thing you
probably didn't mean to publish so much, but if you do want to publish
it it'd be important to resolve this.

Regards,
Colomban
_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a>
<a class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>