how can rewrite the App # process_message to treat the messages of the system? wxruby -- Posted via http://www.ruby-forum.com/.
Marlesson Santana wrote:> how can rewrite the App # process_message to treat the messages of the > system?Could you explain a bit more about what you want. I read the wxWidgets documentation for this method but I don''t know what a "Windows message" is, or how you get one in Windows. We can''t wrap the method if we don''t know what argument type it should take in Ruby. alex
Alex Fenton wrote:> Marlesson Santana wrote: >> how can rewrite the App # process_message to treat the messages of the >> system? > Could you explain a bit more about what you want. I read the wxWidgets > documentation for this method but I don''t know what a "Windows message" > is, or how you get one in Windows. We can''t wrap the method if we don''t > know what argument type it should take in Ruby. > > alexHi alex, Our problem consist in communicate with an external device which connect through the ethernet port. we need to receive the messages sent by it so we can handle. (those messages are events like keydown, keyup, mouse movement and etc.) hope u can give me any direction. gabriel (ps: marlesson is my cowork) -- Posted via http://www.ruby-forum.com/.
Gabriel Rios wrote:> Alex Fenton wrote: > >> Could you explain a bit more about what you want. I read the wxWidgets >> documentation for this method but I don''t know what a "Windows message" >> is, or how you get one in Windows. We can''t wrap the method if we don''t >> know what argument type it should take in Ruby. >> >> alex >> > > Hi alex, > > Our problem consist in communicate with an external device which connect > through the ethernet port. we need to receive the messages sent by it so > we can handle. > > (those messages are events like keydown, keyup, mouse movement and etc.) > > hope u can give me any direction.This isn''t a wxRuby question I think. wxRuby provides a cross-platform abstraction (Wx::Event etc) over GUI events, but if you want to access native Windows messages, you should probably use ruby''s Win32API library. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143459 alex
Alex Fenton wrote:> Gabriel Rios wrote: >> Hi alex, >> >> Our problem consist in communicate with an external device which connect >> through the ethernet port. we need to receive the messages sent by it so >> we can handle. >> >> (those messages are events like keydown, keyup, mouse movement and etc.) >> >> hope u can give me any direction. > This isn''t a wxRuby question I think. wxRuby provides a cross-platform > abstraction (Wx::Event etc) over GUI events, but if you want to access > native Windows messages, you should probably use ruby''s Win32API > library. > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/143459 > > alexthx for that answer alex, this give us a light but im still curious about one thing. You said that this isnt a wxRuby question, but at the documentation there''s the App#process_message[1] that appear to be what we need on our project. But i a have a doubt related to it. It''s implemented at the wxRuby or we should write it and then the wxRuby main_loop will always call it? (is it already implemented at wxRuby?) gabriel (file:///home/gabriel/wxruby.rubyforge.org/doc/app.html#App_processmessage) -- Posted via http://www.ruby-forum.com/.
ops, i put the link wrong it''s: http://wxruby.rubyforge.org/doc/app.html#App_processmessage -- Posted via http://www.ruby-forum.com/.
Gabriel Rios wrote:> Alex Fenton wrote: > >> This isn''t a wxRuby question I think. wxRuby provides a cross-platform >> abstraction (Wx::Event etc) over GUI events, but if you want to access >> native Windows messages, you should probably use ruby''s Win32API >> library. >> >> You said that this isnt a wxRuby question, but at the documentation >> there''s the App#process_message[1] that appear to be what we need on our >> project. But i a have a doubt related to it. >> >> It''s implemented at the wxRuby or we should write it and then the wxRuby >> main_loop will always call it? (is it already implemented at wxRuby?) >>It''s not currently implemented and should be deleted from the docs. It''s %ignored in this file which generates theWx:: App class in ruby: http://wxruby.rubyforge.org/svn/trunk/wxruby2/swig/classes/App.i I don''t know how it would work - but methods that work by being defined in Ruby and then called as required by wxRuby (for example, Wx::App#filter_event) normally correspond to methods declared as "virtual" in the C++ API docs. The C++ method wxApp::ProcessMessage isn''t so I wonder if it in fact does what you think it does? If you can set up a compiler toolchair (I recommend trying MingW) you could try it out, and if it works, I''d consider a patch. However it doesn''t seem to be a specifically GUI problem, which is why I''d recommend pursuing Win32API first. alex
What would be the function equal to MSWWindowProc() ( http://www.wxwidgets.org/docs/faqmsw.htm#handlewm) to wxruby? 2008/6/3 Alex Fenton <alex at pressure.to>:> Gabriel Rios wrote: > >> Alex Fenton wrote: >> >> >>> This isn''t a wxRuby question I think. wxRuby provides a cross-platform >>> abstraction (Wx::Event etc) over GUI events, but if you want to access >>> native Windows messages, you should probably use ruby''s Win32API library. >>> You said that this isnt a wxRuby question, but at the documentation >>> there''s the App#process_message[1] that appear to be what we need on our >>> project. But i a have a doubt related to it. >>> >>> It''s implemented at the wxRuby or we should write it and then the wxRuby >>> main_loop will always call it? (is it already implemented at wxRuby?) >>> >>> >> > It''s not currently implemented and should be deleted from the docs. It''s > %ignored in this file which generates theWx:: App class in ruby: > http://wxruby.rubyforge.org/svn/trunk/wxruby2/swig/classes/App.i > > I don''t know how it would work - but methods that work by being defined in > Ruby and then called as required by wxRuby (for example, > Wx::App#filter_event) normally correspond to methods declared as "virtual" > in the C++ API docs. The C++ method wxApp::ProcessMessage isn''t so I wonder > if it in fact does what you think it does? > > If you can set up a compiler toolchair (I recommend trying MingW) you could > try it out, and if it works, I''d consider a patch. However it doesn''t seem > to be a specifically GUI problem, which is why I''d recommend pursuing > Win32API first. > > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-- Marlesson R. O. de Santana Graduando em Ci?ncias da Computa??o - UESC Programador Web -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20080605/d6e441d6/attachment.html>
Marlesson Santana wrote:> What would be the function equal to MSWWindowProc() > (http://www.wxwidgets.org/docs/faqmsw.htm#handlewm) to wxruby?I don''t believe there is an equivalent. Again, if you''re looking to deal with Windows=specific features, I would say the various Win32 libraries out there for ruby would be a better place to look. wxRuby doesn''t aim to be a complete re-implementation of wxWidgets in Ruby. Rather it aims to provide a native, cross-platform GUI toolkit for Ruby by using parts of wxWidgets. So a lot of non-GUI and cross-platform stuff is omitted. alex
Hello Marlesson, The best suggestion that we can truely make, is to use the Wx::Window#get_handle() method, to retrive the actual native HWND of the window, and use that in cooperation of the Win32 libraries. You would need to be able to get he Current WndProc of the Window (Which is the wxWidget''s Window Procedure that is executed for the Main Loop), and create your own Custom WndProc to handle messages comming in to the window. If it''s a message that you need, then you process it like normal, in your own code, otherwise, you call the WndProc that was originally associated with the Window (The wxWidgets WndProc), with the un-modified values for HWND, iMsg, wParam, lParam. Now, this is the only thing we can suggest. This is very much untested, and no garuntee''s that it would work in any case. For us to wrap MSWWindowProc(), would only be useful on Windows. We''d rather only port Methods that are useful across all platforms. And I must stress this, there is no garuntee this would work, and may have un-desired results. We cannot officially support this method in any way possible, outside of showing you the option. The details of the implementation is entirely up to you, and you will have to look through the documentation for the Win32 libraries, to see if you can find what you want to make this work. Sorry we can''t be of much more help then this, L8ers, On Thu, Jun 5, 2008 at 10:19 AM, Alex Fenton <alex at pressure.to> wrote:> Marlesson Santana wrote: > >> What would be the function equal to MSWWindowProc() ( >> http://www.wxwidgets.org/docs/faqmsw.htm#handlewm) to wxruby? >> > I don''t believe there is an equivalent. Again, if you''re looking to deal > with Windows=specific features, I would say the various Win32 libraries out > there for ruby would be a better place to look. > > wxRuby doesn''t aim to be a complete re-implementation of wxWidgets in Ruby. > Rather it aims to provide a native, cross-platform GUI toolkit for Ruby by > using parts of wxWidgets. So a lot of non-GUI and cross-platform stuff is > omitted. > > > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20080605/a4a5448e/attachment.html>