#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

View: New views
10 Messages — Rating Filter:   Alert me  

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874>

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool
-----------------------+----------------------------------------------------
 Reporter:  brokentoy  |       Owner:    
     Type:  defect     |      Status:  new
 Priority:  normal     |   Milestone:    
Component:  wxMac      |     Version:    
 Keywords:             |   Blockedby:    
    Patch:  0          |    Blocking:    
-----------------------+----------------------------------------------------
 ToolBarToolBase doesn't seem to be working quite right on OS X (This is
 2.8.7, with Leopard 10.5, universal-debug build).

 The attached patch to the toolbar sample demonstrates the problem, but
 basically, calling something like

  a_tool->Enable(false);

 doesn't update the relevant tool in the toolbar.

 ----

 Also, calling ToolBar->AddTool(a_tool);

 Causes me assertion failures, specifically in src/mac/carbon/toolbar.cpp
 1511
  wxASSERT( tool->GetControlHandle() == NULL );

 When a ToolBarToolBase is created with new, its members
 m_controlHandle and m_toolbarItemRef aren't initialised to NULL. This will
 also segfault later when adding a toolbar if we try to CFRelease a non-
 existent m_toolbarItemRef (same file, line 138).


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:1>

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool
------------------------+---------------------------------------------------
  Reporter:  brokentoy  |       Owner:                
      Type:  defect     |      Status:  infoneeded_new
  Priority:  normal     |   Milestone:                
 Component:  wxMac      |     Version:                
Resolution:             |    Keywords:                
 Blockedby:             |       Patch:  0            
  Blocking:             |  
------------------------+---------------------------------------------------
Changes (by csomor):

  * status:  new => infoneeded_new


Comment:

 Hi

 I don't understand the issue with 'new', you always have to create a new
 tool usingCreateTool, you cannot just instantiate the base class and add
 that to the toolbar

 Thanks,

 Stefan


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:1>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:2>

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool
------------------------+---------------------------------------------------
  Reporter:  brokentoy  |       Owner:    
      Type:  defect     |      Status:  new
  Priority:  normal     |   Milestone:    
 Component:  wxMac      |     Version:    
Resolution:             |    Keywords:    
 Blockedby:             |       Patch:  0  
  Blocking:             |  
------------------------+---------------------------------------------------
Changes (by csomor):

  * status:  infoneeded_new => new


Comment:

 As for disabling the tool :

 the API for doing this is EnableTool on the toolbar, eg in your case

 {{{
     toolBar->EnableTool(wxID_NEW, false );
 }}}

 [http://docs.wxwidgets.org/stable/wx_wxtoolbar.html#wxtoolbarenabletool]

 Best,

 Stefan


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:2>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:3>

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool
------------------------+---------------------------------------------------
  Reporter:  brokentoy  |       Owner:                
      Type:  defect     |      Status:  infoneeded_new
  Priority:  normal     |   Milestone:                
 Component:  wxMac      |     Version:                
Resolution:             |    Keywords:                
 Blockedby:             |       Patch:  0            
  Blocking:             |  
------------------------+---------------------------------------------------
Changes (by csomor):

  * status:  new => infoneeded_new



--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:3>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:4>

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool
------------------------+---------------------------------------------------
  Reporter:  brokentoy  |       Owner:    
      Type:  defect     |      Status:  new
  Priority:  normal     |   Milestone:    
 Component:  wxMac      |     Version:    
Resolution:             |    Keywords:    
 Blockedby:             |       Patch:  0  
  Blocking:             |  
------------------------+---------------------------------------------------
Changes (by brokentoy):

  * status:  infoneeded_new => new


Comment:

 OK, thanks for the clarification. Just ignore that part of the problem
 then (with new). I inferred (wrongly) from the method signature for
 AddTool that ToolBarToolBase could be instantiated directly and added.

 Perhaps I might submit a doc patch as ToolBarToolBase is undocumented.

 Regards
 Alex


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:4>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:5>

#9874: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool
------------------------+---------------------------------------------------
  Reporter:  brokentoy  |       Owner:    
      Type:  defect     |      Status:  new
  Priority:  normal     |   Milestone:    
 Component:  wxMac      |     Version:    
Resolution:             |    Keywords:    
 Blockedby:             |       Patch:  0  
  Blocking:             |  
------------------------+---------------------------------------------------

Comment(by brokentoy):

 Re EnableTool - I know this can be done via ToolBar directly. I don't
 personally mind if this is the *only* way to do it - I'm just trying to
 clarify what should work so I can document the API for wxRuby.

 However, ToolBarToolBase.Enable does work on GTK (tested today with
 2.8.7), and the existence of the method (and similar) and comments here:
 http://trac.wxwidgets.org/ticket/2000 make me think there's an expectation
 it should work everywhere - and so I filed the bug.

 For now I will recommend that wxRuby users don't try to use ToolBarTool to
 do anything other than receive the return value of AddTool and friends.

 Best
 alex


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:5>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool (was: ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool)

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:6>

#9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not
updating, can't use with AddTool
---------------------------+------------------------------------------------
  Reporter:  brokentoy     |       Owner:  csomor  
      Type:  defect        |      Status:  accepted
  Priority:  normal        |   Milestone:          
 Component:  doxygen docs  |     Version:          
Resolution:                |    Keywords:          
 Blockedby:                |       Patch:  0      
  Blocking:                |  
---------------------------+------------------------------------------------
Changes (by csomor):

  * owner:  => csomor
  * status:  new => accepted
  * component:  wxMac => doxygen docs


Comment:

 Hi Alex

 exactely, wxToolBarToolBase* should be regarded as an opaque handle, I
 agree that it is tempting to call the methods, but eg neither gtk nor msw
 reflect a change on the tool, only when a next Realize call is made, this
 is done on these port (but nothing similar happens on OSX) while
 EnableTool is visible immediately on all platforms ..

 so the remaining TODO item here for us is to document this clearly

 Thanks,

 Stefan


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:6>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:7>

#9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not
updating, can't use with AddTool
---------------------------+------------------------------------------------
  Reporter:  brokentoy     |       Owner:  csomor  
      Type:  defect        |      Status:  accepted
  Priority:  normal        |   Milestone:          
 Component:  doxygen docs  |     Version:          
Resolution:                |    Keywords:          
 Blockedby:                |       Patch:  0      
  Blocking:                |  
---------------------------+------------------------------------------------

Comment(by brokentoy):

 I hope the attached patches to the 2.8.7 (latex) and SVN HEAD (doxygen)
 docs are helpful in clarifying what wxToolBarToolBase is meant to do.

 Best
 alex


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:7>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:8>

#9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not
updating, can't use with AddTool
---------------------------+------------------------------------------------
  Reporter:  brokentoy     |       Owner:  csomor  
      Type:  defect        |      Status:  accepted
  Priority:  normal        |   Milestone:          
 Component:  doxygen docs  |     Version:  2.8.x  
Resolution:                |    Keywords:          
 Blockedby:                |       Patch:  1      
  Blocking:                |  
---------------------------+------------------------------------------------
Changes (by brokentoy):

  * version:  => 2.8.x
  * patch:  0 => 1


Comment:

 Forgot to tick the patch field


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:8>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev

Re: #9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not updating, can't use with AddTool

by wxTrac :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:9>

#9874: Document ToolBarTool handling, was :ToolBarToolBase on OS X: toolbar not
updating, can't use with AddTool
---------------------------+------------------------------------------------
  Reporter:  brokentoy     |       Owner:  csomor
      Type:  defect        |      Status:  closed
  Priority:  normal        |   Milestone:        
 Component:  doxygen docs  |     Version:  2.8.x
Resolution:  fixed         |    Keywords:        
 Blockedby:                |       Patch:  1    
  Blocking:                |  
---------------------------+------------------------------------------------
Changes (by FM):

  * status:  accepted => closed
  * resolution:  => fixed


Comment:

 (In [56909]) clarify role of wxToolBarToolBase (fixes #9874)


--
Ticket URL: <http://trac.wxwidgets.org/ticket/9874#comment:9>
_______________________________________________
wx-dev mailing list
wx-dev@...
http://lists.wxwidgets.org/mailman/listinfo/wx-dev
LightInTheBox - Buy quality products at wholesale price!