[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Korundum: error when overriding a KDE::RootPixmap method

Martin Traverso

2/5/2005 6:11:00 PM

Hi,

I'm experimenting a bit with Korundum, but I'm having some problems. I have
the following code:

require 'Korundum'

app = Qt::Application.new([])
widget = Qt::Widget.new
pixmap = KDE::RootPixmap.new(widget)

class << pixmap
def updateBackground(x)
puts "update background"
end
end

pixmap.start

widget.show
app.setMainWidget(widget)
app.exec

When I run it I get this error:

ArgumentError: Cannot handle 'KSharedPixmap*' as argument of virtual method
KRootPixmap::updateBackground
from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
`method_missing'
from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in `qt_invoke'
from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
`method_missing'
from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in `exec'

If I remove the class << pixmap ... end section the program runs ok (but does
not do what I want, of course). Any idea of what the error means in this
context? What am I doing wrong?

Thanks for your help.

Martin


14 Answers

Mark Firestone

2/5/2005 6:19:00 PM

0

I want to build an internet email server into my Ruby BBS project. Does
anyone know of a good API to use?

Thanks,

Mark



Richard Dale

2/5/2005 7:19:00 PM

0

Martin Traverso wrote:

> Hi,
>
> I'm experimenting a bit with Korundum, but I'm having some problems. I
> have the following code:
>
> require 'Korundum'
>
> app = Qt::Application.new([])
> widget = Qt::Widget.new
> pixmap = KDE::RootPixmap.new(widget)
>
> class << pixmap
> def updateBackground(x)
> puts "update background"
> end
> end
>
> pixmap.start
>
> widget.show
> app.setMainWidget(widget)
> app.exec
>
> When I run it I get this error:
>
> ArgumentError: Cannot handle 'KSharedPixmap*' as argument of virtual
> method KRootPixmap::updateBackground
> from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
> `method_missing'
> from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
> `qt_invoke' from
> /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
> `method_missing'
> from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in `exec'
>
> If I remove the class << pixmap ... end section the program runs ok (but
> does not do what I want, of course). Any idea of what the error means in
> this context? What am I doing wrong?
That means that 'KSharedPixmap*' is an unknown argument type, and can't be
marshalled from a C++ instance to a ruby value.

The problem is that the KSharedPixmap code in ksharedpixmap.h is bracketed
with:

#ifdef Q_WS_X11
....

#endif

And at the moment platform specific code is ignored when generating the
bindings, so that class isn't added to the Smoke library's runtime, and
can't be used from Korundum.

As it happens I was just looking at another '#ifdef' related problem for
Q_OS_UNIX - that code was being skipped too. I'll try and fix this for the
next release of Korundum (ie for KDE 3.4).

-- Richard

Matt Armstrong

2/5/2005 8:25:00 PM

0

"Mark Firestone" <hash_bang@retrobbs.org> writes:

> I want to build an internet email server into my Ruby BBS project.
> Does anyone know of a good API to use?

Are you talking about an SMTP server? Try looking at the code for
http://raa.ruby-lang.org/proj... (but it looks unfinished)


--
matt


Aredridel

2/5/2005 8:31:00 PM

0

On Sun, 6 Feb 2005 03:18:30 +0900, Mark Firestone
<hash_bang@retrobbs.org> wrote:
> I want to build an internet email server into my Ruby BBS project. Does
> anyone know of a good API to use?
>

POP, IMAP, SMTP or otherwise?

To do what?


Mark Firestone

2/5/2005 9:26:00 PM

0

Ok. Here's the plan.

I have this here BBS. It knows how to speak fidonet and qwk/rep net,
but I would also like the users on it to be able to send and receive
smtp mail, and I would like to be able to use it as a listserv... so
that you could have a message area that exported new messages to folks
email accounts and imported incoming emails to the message area.

So, say general messages would be general@bbs.retrobbs.org and such.

I've been thinking I could use the Sendmail built into slackware. I
think I can configure it to accept any incoming email and put it in
/usr/spool/mail ? I don't really know much about it...

Take Care,

Mark

-----Original Message-----
From: Aredridel [mailto:aredridel@gmail.com]
Sent: 05 February 2005 20:31
To: ruby-talk ML
Subject: Re: Email API

On Sun, 6 Feb 2005 03:18:30 +0900, Mark Firestone
<hash_bang@retrobbs.org> wrote:
> I want to build an internet email server into my Ruby BBS project.
Does
> anyone know of a good API to use?
>

POP, IMAP, SMTP or otherwise?

To do what?




Mark Firestone

2/5/2005 9:29:00 PM

0

What I'd really like to do is use sendmail on this slackware box, and
just talk to it. I looked at smtpd, and it's something I could work
on... but it seems like more work that needs to be done?

I also would want to integrate it into the BBS program, and I don't
think I can use ports < 1024 on linux without some sort of special magic
(or running as root)... Hmmm.

Take Care,

Mark

-----Original Message-----
From: Matt Armstrong [mailto:matt@lickey.com]
Sent: 05 February 2005 20:25
To: ruby-talk ML
Subject: Re: Email API

"Mark Firestone" <hash_bang@retrobbs.org> writes:

> I want to build an internet email server into my Ruby BBS project.
> Does anyone know of a good API to use?

Are you talking about an SMTP server? Try looking at the code for
http://raa.ruby-lang.org/proj... (but it looks unfinished)


--
matt




Matt Armstrong

2/6/2005 4:00:00 AM

0

"Mark Firestone" <hash_bang@retrobbs.org> writes:

> Ok. Here's the plan.
>
> I have this here BBS. It knows how to speak fidonet and qwk/rep
> net, but I would also like the users on it to be able to send and
> receive smtp mail, and I would like to be able to use it as a
> listserv... so that you could have a message area that exported new
> messages to folks email accounts and imported incoming emails to the
> message area.
>
> So, say general messages would be general@bbs.retrobbs.org and such.
>
> I've been thinking I could use the Sendmail built into slackware. I
> think I can configure it to accept any incoming email and put it in
> /usr/spool/mail ? I don't really know much about it...
>
> Take Care,
>
> Mark

For sending email, Ruby has that built in. Check out Net::SMTP. Your
Slackware box will have sendmail listening, and Net::SMTP can send to
it. The advantage of this approach is that someday your SMTP server
may change machines, and your BBS can just point to the new host.

For receiving email, you have a lot of options. I don't know all that
much about Sendmail, and how you can configure it (I am more familiar
with Postfix). I assume you will have some set of valid recipients,
and you'll want to some how inject the received messages into your BBS
for specific users?

If you end up having sendmail run a ruby script (via .forward or
otherwise) you might consider my program http://www.licke... --
it will prevent "random" errors from causing mail bounces.

I have also written a local mail delivery agent (like procmail) -- see
http://www.lickey.com/r...



--
matt


Aria Stewart

2/7/2005 7:41:00 AM

0


> So, say general messages would be general@bbs.retrobbs.org and such.
>
> I've been thinking I could use the Sendmail built into slackware. I
> think I can configure it to accept any incoming email and put it in
> /usr/spool/mail ? I don't really know much about it...

One could have sendmail inject messages into the BBS, with an alias to a
pipe:

general: "|/usr/local/bbs/bin/deliver-bbs-message"



Richard Dale

2/7/2005 12:28:00 PM

0

<posted & mailed>

Richard Dale wrote:

> Martin Traverso wrote:
>
>> Hi,
>>
>> I'm experimenting a bit with Korundum, but I'm having some problems. I
>> have the following code:
>>
>> require 'Korundum'
>>
>> app = Qt::Application.new([])
>> widget = Qt::Widget.new
>> pixmap = KDE::RootPixmap.new(widget)
>>
>> class << pixmap
>> def updateBackground(x)
>> puts "update background"
>> end
>> end
>>
>> pixmap.start
>>
>> widget.show
>> app.setMainWidget(widget)
>> app.exec
>>
>> When I run it I get this error:
>>
>> ArgumentError: Cannot handle 'KSharedPixmap*' as argument of virtual
>> method KRootPixmap::updateBackground
>> from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
>> `method_missing'
>> from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
>> `qt_invoke' from
>> /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in
>> `method_missing'
>> from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in `exec'
>>
>> If I remove the class << pixmap ... end section the program runs ok (but
>> does not do what I want, of course). Any idea of what the error means in
>> this context? What am I doing wrong?
> That means that 'KSharedPixmap*' is an unknown argument type, and can't be
> marshalled from a C++ instance to a ruby value.
>
> The problem is that the KSharedPixmap code in ksharedpixmap.h is bracketed
> with:
>
> #ifdef Q_WS_X11
> ...
>
> #endif
>
> And at the moment platform specific code is ignored when generating the
> bindings, so that class isn't added to the Smoke library's runtime, and
> can't be used from Korundum.
>
> As it happens I was just looking at another '#ifdef' related problem for
> Q_OS_UNIX - that code was being skipped too. I'll try and fix this for the
> next release of Korundum (ie for KDE 3.4).
I've tried getting the KSharedPixmap class wrapped, but it uses multiple
inheritance with a diamond shaped hierachy and I had trouble getting the
C++ code for the binding to compile. So it might not be possible to include
it I'm afraid.

-- Richard

Mark Firestone

2/8/2005 3:31:00 PM

0

Thanks guys!

I decided to go with Ruby Mail to read messages in a mailbox that I
configured sendmail to put all messages sent to @bbs.retrobbs.org in.

This seems to work just fine... the only problem I am having is sending
messages. Sendmail is attaching the full username of the account that
runs the BBS software.. so I am getting ...

Mark Firestone whatever@bbs.retrobbs.org

Is there anyway to override this with NET::SMTP. I couldn't see one in
the docs...

Thanks!

Mark

-----Original Message-----
From: Aredridel [mailto:aredridel@nbtsc.org]
Sent: 07 February 2005 07:41
To: ruby-talk ML
Subject: Re: Email API


> So, say general messages would be general@bbs.retrobbs.org and such.
>
> I've been thinking I could use the Sendmail built into slackware. I
> think I can configure it to accept any incoming email and put it in
> /usr/spool/mail ? I don't really know much about it...

One could have sendmail inject messages into the BBS, with an alias to a
pipe:

general: "|/usr/local/bbs/bin/deliver-bbs-message"