Thanks Larry, this is exactly what I was looking for!<br><br><div class="gmail_quote">On Mon, Apr 2, 2012 at 2:13 PM, Larry Shaffer <span dir="ltr"><<a href="mailto:larrys@dakotacarto.com">larrys@dakotacarto.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Aaron,<br>
<div><div class="h5"><br>
On Mon, Apr 2, 2012 at 2:16 PM, SJWC GIS <<a href="mailto:sjwcgis@gmail.com">sjwcgis@gmail.com</a>> wrote:<br>
> Hello all,<br>
><br>
> I'm creating a qgis python plugin. One of the functions of the plugin is to<br>
> customize the qgis interface by turning off a few toolbars. For most<br>
> toolbars, this isn't a problem, but for some reason I can't find a way to<br>
> shut off the "Label" toolbar. For most toolbars, the following statements<br>
> are working...<br>
><br>
> self.iface.digitizeToolBar().setVisible(False)<br>
><br>
> But I can't find a labelToolBar() object that I can do this operation with.<br>
> Does anyone have any guidance on why this is different? I'm not noticing<br>
> any plugins that might be influencing this... Thanks!<br>
<br>
</div></div>Seems there is no method in the QgisInterface class for accessing the<br>
new label toolbar yet.<br>
<br>
Try...<br>
<br>
iface.mainWindow().findChild(QToolBar,"mLabelToolBar").setVisible(False)<br>
<br>
I found the object name for the label toolbar using:<br>
<br>
toolbars = iface.mainWindow().findChildren(QToolBar)<br>
<br>
for toolbar in toolbars:<br>
print toolbar.objectName()<br>
<br>
Which returned this on my QGIS setup:<br>
<br>
mFileToolBar mLayerToolBar mDigitizeToolBar<br>
mAdvancedDigitizeToolBar mMapNavToolBar mAttributesToolBar<br>
mPluginToolBar mHelpToolBar mRasterToolBar mLabelToolBar OpenStreetMap<br>
<br>
<br>
There's probably a more direct solution than the 'findChild()' method.<br>
<br>
Regards,<br>
<br>
Larry Shaffer<br>
Dakota Cartography<br>
Black Hills, South Dakota<br>
</blockquote></div><br>