# Can't subclass AuiDockArt

**URL:** <https://www.ruby-forum.com/t/cant-subclass-auidockart/153029>\
**Category:** wxRuby\
**Created:** [November 11, 2008, 10:11am UTC](https://www.ruby-forum.com/t/cant-subclass-auidockart/153029 "2008-11-11T10:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bcef8e/32.png) [@phi](https://www.ruby-forum.com/u/phi)\
**Post date:** [November 11, 2008, 10:11am UTC](https://www.ruby-forum.com/t/cant-subclass-auidockart/153029/1 "2008-11-11T10:11:41Z")

</div>

Hi,

I’m using wxRuby with the Aui classes. Everything is fine (Manager,  
ToolBars, Panes, …) and now i want to override the default drawing for  
the manager.

Thus I want to use #set\_art\_provider to give my implementation. When  
doing that I receive a SWIG exceptions:

Expected argument 1 of type wxAuiDockArt \*, but got DockArtProvider  
#DockArtProvider:0x3682e5c  
in SWIG method ‘SetArtProvider’

The DockArtProvider class (ruby class) inherits from AuiDockArt like so:  
class DockArtProvider \< Wx::AuiDockArt  
…  
end

Is something wrong on my side or on SWIG’s one?

---

<div class="post-metadata">

**Author:** ![phi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bcef8e/32.png) [@phi](https://www.ruby-forum.com/u/phi)\
**Post date:** [November 11, 2008, 10:57am UTC](https://www.ruby-forum.com/t/cant-subclass-auidockart/153029/2 "2008-11-11T10:57:49Z")

</div>

Hi Pascal

Pascal H. wrote:

> The DockArtProvider class (ruby class) inherits from AuiDockArt like so:  
> class DockArtProvider \< Wx::AuiDockArt  
> …  
> end
> 
> Is something wrong on my side or on SWIG’s one?

Hehe. It was a long time ago that I added the AUI classes, and in those  
days I wasn’t very good at classes with virtual methods called from C++  
into Ruby. And I thought “who would ever bother to define their own  
DockArt drawing in wxRuby?”.

It’s really nice to hear about people pushing the library and wanting to  
use these advanced features. If you could file a bug please, and attach  
a minimal sample with an AuiManager and AuiDockArt subclass with the  
needed methods defined, I’m happy to have a go at fixing it.

By the way, I think I took the same attitude to AuiTabArt, so if you  
would define your own AuiNoteBook drawing methods, please file that as a  
separate bug.

alex

---

<div class="post-metadata">

**Author:** ![phi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bcef8e/32.png) [@phi](https://www.ruby-forum.com/u/phi)\
**Post date:** [November 11, 2008, 11:05am UTC](https://www.ruby-forum.com/t/cant-subclass-auidockart/153029/3 "2008-11-11T11:05:32Z")

</div>

Alex F. wrote:

> It’s really nice to hear about people pushing the library and wanting to  
> use these advanced features. If you could file a bug please, and attach  
> a minimal sample with an AuiManager and AuiDockArt subclass with the  
> needed methods defined, I’m happy to have a go at fixing it.

Great, I’ll prepare that and submit a ticket.

> By the way, I think I took the same attitude to AuiTabArt, so if you  
> would define your own AuiNoteBook drawing methods, please file that as a  
> separate bug.

Yes, AuiTabArt will be the next one, but just before I have  
AuiToolBarArt!  
For the latter, I’m currently creating SWIG files for wxRuby because  
AuiToolBar and its AuiToolBarItem were not yet defined. I’ll also submit  
them in a separate ticket (enhancement or the like)

Thanx for your support Alex.

Pascal.

---

<div class="post-metadata">

**Author:** ![phi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bcef8e/32.png) [@phi](https://www.ruby-forum.com/u/phi)\
**Post date:** [November 12, 2008, 1:16pm UTC](https://www.ruby-forum.com/t/cant-subclass-auidockart/153029/4 "2008-11-12T13:16:59Z")

</div>

Alex, You did right with SWIG AuiDockArt.

My sample application was changing the constructor signature by having  
an argument in the ruby initialize method. When this happens, SWIG  
generated code detects it and throws an “type mismatch” exception (the  
one reported in the initial message). I’ve learned something today (that  
sounds very coherent!).

I’ll still fill a ticket to have AuiDefaultDockArt available so we can  
simply subclass it to customize only one or two methods.

Best Regards,

Pascal.
