title: Blender 3D ui add button
body: <p>i add button to top of the bar but two buttons are added. how can i fix this problem                             d</p>
  <p><a href="https://i.stack.imgur.com/S5Aps.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  <pre><code>class ExportAll(bpy.types.Menu):
      bl_label = &quot;ExportAll&quot;
      bl_idname = &quot;OBJECT_MT_simple_custom_menu&quot;
  
      def draw(self, context):
          layout = self.layout
  
          obj = context.object
  
          row = layout.row()
          row.operator(&quot;mesh.primitive_cube_add&quot;)
  
  
  def draw_btn(self, context):
      
      layout = self.layout
      row = layout.row(align=True)
      row.operator('mesh.primitive_cube_add',text=&quot;CUP&quot;,icon=&quot;IPO_EXPO&quot;)
  
  def register():
      bpy.utils.register_class(ExportAll)
      bpy.types.TOPBAR_HT_upper_bar.append(draw_btn)
  
  
  def unregister():
      bpy.utils.unregister_class(ExportAll)
      bpy.types.TOPBAR_HT_upper_bar.remove(draw_btn)
  
  if __name__ == &quot;__main__&quot;:
      register()
  </code></pre>