Hey! I would need a popup window like this (not necessarily associated to a taskbaricon): http://www.venraiker.com/wp-content/uploads/2006/03/libnotifyvx.png I should be possible to show such a window for a certain time, displaying a certain message. Is a similar thing possible with wx? Are there oder options? thx ck -- Posted via http://www.ruby-forum.com/.
Hey Ck, On 12/10/07, Christian Kerth <lists at ruby-forum.com> wrote:> > Hey! > I would need a popup window like this (not necessarily associated to a > taskbaricon): > > http://www.venraiker.com/wp-content/uploads/2006/03/libnotifyvx.pngGraphically wise, no, that''s something that you would have to specifically setup to be drawn. But, window popup wise, yes, you can setup a Wx::MiniFrame to create the said popup window. And by utilizing Wx:: SystemSettings.get_metric(Wx::SYS_SCREEN_X) and Wx:: SystemSettings.get_metric(Wx::SYS_SCREEN_Y) you should be able to determine the size of the screen to position your "popup notification" to show, and hide. A quick and dirty example would be: class MyPopupWin < Wx::MiniFrame def initialize(parent,timeout) super(parent) @timer = Timer.new(self,10001) evt_timer(10001) do { @timer.stop; self.show(false); } self.show(true) @timer.start(timeout) end end Note, this is not tested code, just quick spur of the moment type design, but general idea should be there for you to use. L8ers, Mario Steele I should be possible to show such a window for a certain time,> displaying a certain message. > > Is a similar thing possible with wx? Are there oder options? > > thx ck > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20071210/2ac765be/attachment-0001.html
Mario Steele wrote:> class MyPopupWin < Wx::MiniFrame > def initialize(parent,timeout) > super(parent) > @timer = Timer.new(self,10001) > evt_timer(10001) do { @timer.stop; self.show(false); } > self.show(true) > @timer.start(timeout) > end > endDoes a Wx::MiniFrame need a parent window? I doesn''t have a parent window, just a taskbaricon. When i pass nil to the constructor it generates an error. greets ck -- Posted via http://www.ruby-forum.com/.
Wx::MiniFrame does need a Parent Window in order to be created, but not shown. You can create a Simple Window, for the Parent, but that window should not need to be shown in order for the Wx::MiniFrame to be shown. L8ers, Mario Steele On 12/10/07, Christian Kerth <lists at ruby-forum.com> wrote:> > Mario Steele wrote: > > > class MyPopupWin < Wx::MiniFrame > > def initialize(parent,timeout) > > super(parent) > > @timer = Timer.new(self,10001) > > evt_timer(10001) do { @timer.stop; self.show(false); } > > self.show(true) > > @timer.start(timeout) > > end > > end > > Does a Wx::MiniFrame need a parent window? I doesn''t have a parent > window, just a taskbaricon. When i pass nil to the constructor it > generates an error. > > greets ck > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20071210/65fe8a3c/attachment.html