Forum: wxRuby can't subclass AuiDockArt

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4814bd563aa6cf7a06f5cbccca18d340?d=identicon&s=25 Pascal Hurni (phi)
on 2008-11-11 10:11
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?
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2008-11-11 10:57
(Received via mailing list)
Hi Pascal

Pascal Hurni 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
4814bd563aa6cf7a06f5cbccca18d340?d=identicon&s=25 Pascal Hurni (phi)
on 2008-11-11 11:05
Alex Fenton 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.
4814bd563aa6cf7a06f5cbccca18d340?d=identicon&s=25 Pascal Hurni (phi)
on 2008-11-12 13:16
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.
This topic is locked and can not be replied to.