From: Yvon T. <yvo...@gm...> - 2007-09-05 10:06:48
|
i have a rubycocoa application similar to iSync and i'd like having the sync button rotating. i able from a thread to make it rotating when the sync button isn't activated. the same when i use an NSTimer in place of a ruby thread. the sync button stays with an image pressed and darker. no other action are possible until the action of this button is terminated. are those probs specific to rubycocoa ? -- yvon |
From: Laurent S. <lsa...@ap...> - 2007-09-05 10:25:25
|
Yvon, What you need to do is write a custom view that would draw a rotated image. Then you can use NSAnimation or NSTimer to force the display of the control. There are no problems specific to RubyCocoa. Laurent On Sep 5, 2007, at 12:06 PM, Yvon Thoraval wrote: > i have a rubycocoa application similar to iSync and i'd like having > the sync button rotating. > > i able from a thread to make it rotating when the sync button isn't > activated. > > the same when i use an NSTimer in place of a ruby thread. > > the sync button stays with an image pressed and darker. > > no other action are possible until the action of this button is > terminated. > > are those probs specific to rubycocoa ? > > -- > yvon > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Yvon T. <yvo...@gm...> - 2007-09-05 14:54:39
|
2007/9/5, Laurent Sansonetti <lsa...@ap...>: > > Yvon, > > What you need to do is write a custom view that would draw a rotated > image. Then you can use NSAnimation or NSTimer to force the display of > the control. > > There are no problems specific to RubyCocoa. then you mean, apart from the NSButton ? that's to say not having the NSButton image rotating (as in apple iSync) but rather another image aside of it ? thanks, anyway ! -- yvon |
From: Laurent S. <lsa...@ap...> - 2007-09-05 16:05:12
|
On Sep 5, 2007, at 4:54 PM, Yvon Thoraval wrote: > 2007/9/5, Laurent Sansonetti <lsa...@ap...>: Yvon, > > What you need to do is write a custom view that would draw a rotated > image. Then you can use NSAnimation or NSTimer to force the display of > the control. > > There are no problems specific to RubyCocoa. > > > then you mean, apart from the NSButton ? > that's to say not having the NSButton image rotating (as in apple > iSync) but rather another image aside of it ? I would subclass NSButton, provide a custom drawing method that would draw the image, then trigger a timer (using either NSTimer or NSAnimation) that would increment an index and force the button to be redrawn. The image would be drawn in a rotated mode based on the timer index. Laurent |
From: Yvon T. <yvo...@gm...> - 2007-09-06 08:41:38
|
2007/9/5, Laurent Sansonetti <lsa...@ap...>: > > > > I would subclass NSButton, provide a custom drawing method that would > draw the image, then trigger a timer (using either NSTimer or > NSAnimation) that would increment an index and force the button to be > redrawn. The image would be drawn in a rotated mode based on the timer > index. NO, there is no need for a subclass, Luc Heinrich gave me yesterday a working solution : to make the image of a button rotating, this has to be done in the NSRunLoop. then, the action associated to this "rotating button" has to be done in another thread, this works fine with ruby Tread ! Best, -- yvon |
From: Eloy D. <elo...@gm...> - 2007-09-06 10:10:39
|
It might not be needed to subclass, but it would probably be the best way from a design point of view :) As in, the button subclass contains the code related to drawing itself... Cheers, Eloy On 9/6/07, Yvon Thoraval <yvo...@gm...> wrote: > > > 2007/9/5, Laurent Sansonetti <lsa...@ap...>: > > > > > > I would subclass NSButton, provide a custom drawing method that would > > draw the image, then trigger a timer (using either NSTimer or > > NSAnimation) that would increment an index and force the button to be > > redrawn. The image would be drawn in a rotated mode based on the timer > > index. > > NO, there is no need for a subclass, Luc Heinrich gave me yesterday a > working solution : > > to make the image of a button rotating, this has to be done in the > NSRunLoop. > > then, the action associated to this "rotating button" has to be done in > another thread, this works fine with ruby Tread ! > > Best, > > -- > yvon > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > |
From: Yvon T. <yvo...@gm...> - 2007-09-06 15:08:25
|
2007/9/6, Eloy Duran <elo...@gm...>: > > It might not be needed to subclass, but it would probably be the best > way from a design point of view :) > As in, the button subclass contains the code related to drawing itself... Ah, OK, obviously yes... -- yvon |