Can't subclass AuiDockArt


#1

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?


#2

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


#3

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.


#4

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.