Skip to content
This repository
tag: 0.3
Fetching contributors…

Cannot retrieve contributors at this time

file 14 lines (11 sloc) 2.316 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
- connect the 'return' key pressed event to the submit button 2 (5) I spent some time on this but with my scarce knowledge of Cocoa I couldn't find a solution. I tried to tweak on a MacRuby example trying to intercept a key pressed event without success. I think it's better I move on hoping that in the future I'll be able to fix this quickly.

- Encoding from text field: the string you obtain from a text_field instance is UTF-16 (text_field.to_s.encoding). UTF-16 is not even in the list of supported Ruby 1.9 encodings (Encoding.list) but there is a BE/LE specification. If you call the match operator on a UTF-16 string you have a "`=~': regexp preprocess failed: too short escaped multibyte character (ArgumentError)". So I had to convert the string and since neither force_encoding nor encode! works in MacRuby, I had to move the string to bytes and back to string. This is not a final solution of course, because I'm stripping relevant part of multibyte strings. The fix is in pomodoros.rb class fix_encoding method.

- Embedding MacRuby: I tried with the install_name_tool
  -change /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib
  ../Frameworks/MacRuby.framework/Versions/0.4/usr/lib/libmacruby.dylib
  Pomodori.app/Contents/MacOS/Pomodori
which changes the dylib dependencies of the executable. The problem is that it doesn't work with the relative path passed. But if you want to go absolute, then it depend from where the application is installed. If /Applications, I can stuck the absolute path there, but I don't like it. So the plan is to wait some more time and hopefully MacRuby will be part of Leopard snow edition.
- view_layout: man, was not able to understand how it works or how to use it. Reverted back to absolute position for everything. The main complaint is that sometimes all widget disappears if I try to expand in just one direction. You should probably formulate an example and post it to the ML.

Resizeable Cell in Table View:
- If one day you want to have the table view to soft-wrap the text in the cell for long pomodoro descriptions you can use this http://evanjones.ca/software/osx-tableview.html as a starting point
- basically you subclass the table view and intercept the cell draw event to grab cell dimension and wrap the text accordingly
Something went wrong with that request. Please try again.