Here''s a few Mac specific answers for you.
Jeremy Stell-Smith wrote:
> so I''ve been using wxruby for a bit, and I have some questions.
> Before I start, I do want to say, that I am really liking wxruby,
> these questions are a result if really putting it through it''s
paces.
>
>
> 1) how do you assign accelerator keys?
>
> this kind of works if I add a menu item like "&New\tCtrl-N",
but this
> only works for commands in the menu, and for some reason won''t
work
> for function keys, arrow keys, and translates many keys across
> platforms. For example, it translates a "ctrl" key to the
"command"
> key on a mac, but sometimes I actually want to assign the control key
>
> I think that the accelerator class is the key to this, but it seems to
> not be ported, is this correct?
>
True
>
> 2) I need to use a fixed width font, and I was trying to use FontList,
> to find it, but it seems to not be ported as well, is this true? and
> if not, is there a work around? MODERN fonts are NOT fixed width,
> especially on debian
>
True
>
> 3) Are there some memory problems with tree control? I instantiate a
> tree control, add some items and then if I call this code several
> minutes later, I often get a seg fault :
>
> get_item_data(get_selection).absolute_filename
>
> (where absolute_filename is a method on the item data)
>
> this works, for a while and then it starts seg faulting. I''m
guessing
> that somewhere the ruby garbage collection is prematurely collecting
> these items? has anyone else seen this. It''s really annoying
>
This is a GC bug with wxruby - it has to do with wxWindows deleting
item_data objects. The current workaround is to use ruby hashtables
instead of g/set_item_data. wxruby-swig should have more robust memory
management.
>
> 5) this might be more of a wxwindows question, but it seems on OSX, I
> can''t give focus to a button, which means that I can''t
tab through a
> bunch of buttons, nor does the ''&'' in &Ok,
&Cancel work. Does this
> mean that you can not write keyboard driven apps for the mac in
> wxWindows?
>
Hmmm - can''t say I''ve tried it actually.
>
> 4) this isn''t so much a wxruby question, but if anyone knows, I
would
> love to hear the answer. On OSX, how do you change the name of the
> application that is displayed in the menu bar from "ruby" to the
name
> of your app?
You need to "Bundle" your app, which is a tutorial I''ve been
meaning to
write. What I did was write my own ruby startup c program that looked in
the resources folder for "start.rb", and then executed that file. That
binary goes in Contents/MacOS, the ruby scripts and wxruby go in
Contents/Resources, and the Info.plist works as it always does. I can
send you a sample bundle if you like.
Another of my intentions has been to move wxruby into a framework, but
I''ve been buried in contract work. My time is freeing up again, and if
your interested I can get it done.
Nick
>
>
> thanks,
>
> Jeremy
>
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
>