From penguinroad at gmail.com Sun Apr 4 22:22:05 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Mon, 5 Apr 2010 09:22:05 +0700 Subject: [wxruby-users] WxRuby and windows 7 In-Reply-To: <993ee22d9f478faf58cca9853576df70@ruby-forum.com> References: <993ee22d9f478faf58cca9853576df70@ruby-forum.com> Message-ID: On Thu, Apr 1, 2010 at 9:53 AM, tuti plain wrote: > Hi, has anyone been able to use wxRuby on Windows 7. When I run a > basic app I get an error saying that MSVCP71.dll is missing. Any ideas > on how to solve this? > -- > Yes, my code run just fine on win 7 you can search that file and then copy it to ruby/bin folder thats how I usually solve any problem regarding file missing -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Apr 5 04:20:18 2010 From: lists at ruby-forum.com (Sylvain Dubus) Date: Mon, 5 Apr 2010 10:20:18 +0200 Subject: [wxruby-users] problem with the size of notebook pages Message-ID: <4cd9d8ac22412919ba4e664c888560e5@ruby-forum.com> Hi here, I have to make a school project in wxRuby and since 1-2 weeks, i am completely blocked because of a notebook display problem. I don't manage to adapt the size of notebook pages with the content. The size is completely fixed, and so what is inside is cut. And when I try to modify the size, it changes nothing :( Here a part of my notebook class : def initialize(parent) super(parent, -1, Wx::DEFAULT_POSITION) end def create_contact_page() @contacts = Wx::Panel.new(self, :size => [-1, 500]) # the size parameter changes nothing @contacts_box = Wx::BoxSizer.new(Wx::VERTICAL) @label_contact_list = Wx::StaticText.new(@contacts, :label => "Contact list :") @contacts_box.add(@label_contact_list, 1, Wx::ALL, 15) @contacts.set_sizer(@contacts_box) self.add_page(@contacts, "My contacts") end I've linked the result in attachment. Thank you for your help ! Attachments: http://www.ruby-forum.com/attachment/4639/notebook.png -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Mon Apr 5 04:55:29 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Mon, 5 Apr 2010 15:55:29 +0700 Subject: [wxruby-users] problem with the size of notebook pages In-Reply-To: <4cd9d8ac22412919ba4e664c888560e5@ruby-forum.com> References: <4cd9d8ac22412919ba4e664c888560e5@ruby-forum.com> Message-ID: I cannot help with your code but my code is working see if this code helps you good luck require 'rubygems' require 'wx' class Notebook_b < Wx::Frame include Wx def initialize(parent=nil) super parent, -1, "Notebook", DEFAULT_POSITION, Size.new(600,400), DEFAULT_FRAME_STYLE @statusbar = StatusBar.new(self, -1) self.set_status_bar(@statusbar) @statusbar.set_status_text "" @notebook_101 = Notebook.new(self, -1, DEFAULT_POSITION, DEFAULT_SIZE, NB_TOP) @panel_102 = Panel.new(@notebook_101, -1) @flexgridsizer_103 = FlexGridSizer.new( 0, 1, 5, 5 ) @flexgridsizer_103.add_growable_col 0 @static_text_104 = StaticText.new(@panel_102, -1, "hello world", DEFAULT_POSITION, DEFAULT_SIZE, ALIGN_LEFT) @flexgridsizer_103.add(@static_text_104, 0, Wx::ALL | Wx::ALIGN_LEFT | Wx::ALIGN_TOP | Wx::EXPAND ) @panel_102.set_sizer( @flexgridsizer_103 ) @notebook_101.add_page @panel_102, "My Tab" evt_close{ |event| on_close(event) } on_load() end def on_close(event) event.skip end def on_load() end end On Mon, Apr 5, 2010 at 3:20 PM, Sylvain Dubus wrote: > Hi here, > > I have to make a school project in wxRuby and since 1-2 weeks, i am > completely blocked because of a notebook display problem. > > I don't manage to adapt the size of notebook pages with the content. The > size is completely fixed, and so what is inside is cut. And when I try > to modify the size, it changes nothing :( Here a part of my notebook > class : > > > def initialize(parent) > super(parent, -1, Wx::DEFAULT_POSITION) > end > > def create_contact_page() > @contacts = Wx::Panel.new(self, :size => [-1, 500]) > # the size parameter changes nothing > > @contacts_box = Wx::BoxSizer.new(Wx::VERTICAL) > > @label_contact_list = Wx::StaticText.new(@contacts, :label => > "Contact list :") > @contacts_box.add(@label_contact_list, 1, Wx::ALL, 15) > > @contacts.set_sizer(@contacts_box) > > self.add_page(@contacts, "My contacts") > end > > > I've linked the result in attachment. > > Thank you for your help ! > > Attachments: > http://www.ruby-forum.com/attachment/4639/notebook.png > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Apr 5 08:28:22 2010 From: lists at ruby-forum.com (Sylvain Dubus) Date: Mon, 5 Apr 2010 14:28:22 +0200 Subject: [wxruby-users] problem with the size of notebook pages In-Reply-To: References: <4cd9d8ac22412919ba4e664c888560e5@ruby-forum.com> Message-ID: hendra kusuma wrote: > I cannot help with your code > but my code is working > see if this code helps you > good luck Thank you Hendra, I tried your code and I had the same problem. So I understood that it was not the notebook that was bugging, but something else. Finally, the problem is where I add the notebook to my main boxsizer. I forgot to put the proportion parameter to 1 !! It was at 0 so it took the smallest possible place... -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Tue Apr 6 04:06:37 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Tue, 6 Apr 2010 15:06:37 +0700 Subject: [wxruby-users] problem with the size of notebook pages In-Reply-To: References: <4cd9d8ac22412919ba4e664c888560e5@ruby-forum.com> Message-ID: You're welcome On Mon, Apr 5, 2010 at 7:28 PM, Sylvain Dubus wrote: > hendra kusuma wrote: > > I cannot help with your code > > but my code is working > > see if this code helps you > > good luck > > Thank you Hendra, I tried your code and I had the same problem. So I > understood that it was not the notebook that was bugging, but something > else. Finally, the problem is where I add the notebook to my main > boxsizer. > I forgot to put the proportion parameter to 1 !! It was at 0 so it took > the smallest possible place... > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Tue Apr 6 05:13:56 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Tue, 6 Apr 2010 16:13:56 +0700 Subject: [wxruby-users] numeric textbox Message-ID: Dear all, what is a good way to implement a textbox that can only receive number? when I tried to implement it using text_updated event it runs so slow that it disturb overall process (my menu stop working) or even better, what method to overwrite in wxtextctrl class to achieve the goal? Regards Hendra -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Apr 6 07:04:55 2010 From: alex at pressure.to (Alex Fenton) Date: Tue, 06 Apr 2010 12:04:55 +0100 Subject: [wxruby-users] numeric textbox In-Reply-To: References: Message-ID: <4BBB1557.80001@pressure.to> Hi Hendra hendra kusuma wrote: > what is a good way to implement a textbox that can only receive number? The best way is to use Validators. There's a pre-built one for controlling numerics: Wx::TextCtrl.new(parent, :validator => Wx::TextValidator.new(Wx::FILTER_NUMERIC) ) cheers alex From penguinroad at gmail.com Tue Apr 6 23:49:03 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Wed, 7 Apr 2010 10:49:03 +0700 Subject: [wxruby-users] numeric textbox In-Reply-To: <4BBB1557.80001@pressure.to> References: <4BBB1557.80001@pressure.to> Message-ID: On Tue, Apr 6, 2010 at 6:04 PM, Alex Fenton wrote: > Hi Hendra > > > hendra kusuma wrote: > >> what is a good way to implement a textbox that can only receive number? >> > > The best way is to use Validators. There's a pre-built one for controlling > numerics: > > Wx::TextCtrl.new(parent, > :validator => Wx::TextValidator.new(Wx::FILTER_NUMERIC) ) > I tried filter_numeric before and found out if it only filter input, not realy confirm if the number correct I try to workaround a bit using key_update event and filter some more key like + - , . e well, it works well, the trick is to use* change_value*, not *set_value* somehow, when I try to add humanizing number function, I got stuck (humanizing = 10000 -> 10,000) because I cannot move my cursor / insert point to the last of textctrl and *set_insertion_point_end* does not seem to work is there a way to fix this? -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Apr 12 09:34:47 2010 From: lists at ruby-forum.com (Diane Jones) Date: Mon, 12 Apr 2010 15:34:47 +0200 Subject: [wxruby-users] Compiling problem on Ubuntu 9.10 64 bit In-Reply-To: <82f308d44ad97efab8adf88a3eda08e1@ruby-forum.com> References: <51676e8059b9d963a30fb3a02c64f7e9@ruby-forum.com> <12760e534b7152c4ff245f2e2b58cfd3@ruby-forum.com> <9797c10c9ad91c94e9367a8e340d9a46@ruby-forum.com> <82f308d44ad97efab8adf88a3eda08e1@ruby-forum.com> Message-ID: <672bef55e32e09658e98fe8db9815b45@ruby-forum.com> Carlo Bertini wrote: > Marvin G?lker wrote: > >> >> However, your gem works, so thank you! >> > > Nothing :D > > Carlo Bertini > > www.waydotnet.com To be social is very positive aspect in this age of materialism. Life is moving very fast and embedded with full luxuries. In this fast life dedicated hosting is too facilitating for your comfort and minimizing all tensions. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Apr 13 11:53:29 2010 From: lists at ruby-forum.com (Dave Hackamack) Date: Tue, 13 Apr 2010 17:53:29 +0200 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard In-Reply-To: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> References: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> Message-ID: <46ea2b88a283e7320a6ec8c44526791c@ruby-forum.com> Antti Hakala wrote: > Hello, > I have a static gem of wxruby 2.0.1 that works on OS X Snow Leopard, > if somebody is interested. > I've tried it only on my own comp. It's about 9MB. Please send a copy my way when you get a chance. Thanks, gnudlh at gmail.com -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Apr 14 10:45:18 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Wed, 14 Apr 2010 16:45:18 +0200 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard In-Reply-To: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> References: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> Message-ID: <8585e78557c4f5913f1ae444428814bf@ruby-forum.com> Antti Hakala wrote: > Hello, > I have a static gem of wxruby 2.0.1 that works on OS X Snow Leopard, > if somebody is interested. > I've tried it only on my own comp. It's about 9MB. +1 for hosting (looking at the number of requests so far, I feel like I'm piling on to ask too :-) Pls send to wxrubyosx [at] spress [dot] ws Many thanks! Roger -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Apr 14 10:49:11 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Wed, 14 Apr 2010 16:49:11 +0200 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard In-Reply-To: <4BA9B9BD.6090602@pressure.to> References: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> <4BA9B9BD.6090602@pressure.to> Message-ID: Alex Fenton wrote: > Hi > > I wonder if anyone who's built on Snow Leopard could let me know what > platforms they built for. Have just got round to looking at this, and > I'm having trouble building a universal wxWidgets that targets 10.4, > 10.5 and 10.6. > > Is targetting 10.4 still important for users? > > cheers > alex I can't speak for others, but we have two Macs at our house running 10.5 (and will likely move to 10.6 on one of those this month). Roger -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Apr 14 11:09:41 2010 From: lists at ruby-forum.com (Edgar J. Suarez) Date: Wed, 14 Apr 2010 17:09:41 +0200 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard In-Reply-To: References: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> <4BA9B9BD.6090602@pressure.to> Message-ID: <43d0f10b7bb80ed573faa5039f64b7fc@ruby-forum.com> I've uploaded the gem to amazon S3. Thanks to Antti for sharing it. However it haven't work for me, I may need extra libs or something. Anyways, feel free to try it yourselves: http://j.mp/9vmqne Roger Sperberg wrote: > Alex Fenton wrote: >> Hi >> >> I wonder if anyone who's built on Snow Leopard could let me know what >> platforms they built for. Have just got round to looking at this, and >> I'm having trouble building a universal wxWidgets that targets 10.4, >> 10.5 and 10.6. >> >> Is targetting 10.4 still important for users? >> >> cheers >> alex > > I can't speak for others, but we have two Macs at our house running 10.5 > (and will likely move to 10.6 on one of those this month). > > Roger -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Apr 18 08:10:30 2010 From: lists at ruby-forum.com (Ken Uraya) Date: Sun, 18 Apr 2010 14:10:30 +0200 Subject: [wxruby-users] how to display ListCtrl_virtual using xrcise Message-ID: Hi, I'm trying to display text in a ListCtrl_virtual using xrcise. To display text, I implemented on_get_item_text() method in TestListCtrl module. However, no text displayed in my list. I'd appreciate it if you could teach me how to display text. My environment: > ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-mswin32] > gem list *** LOCAL GEMS *** wx_sugar (0.1.22) wxruby (2.0.1) Here is my sample code: - testlistctrl.xrc 500,300 - testlistctrlbase.rb (xrcise output) class TestFrameBase < Wx::Frame attr_reader :m_listctrl3 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("testlistctrl.xrc") xml.load_frame_subclass(self, parent, "TestFrame") finder = lambda do | x | int_id = Wx::xrcid(x) begin Wx::Window.find_window_by_id(int_id, self) || int_id # Temporary hack to work around regression in 1.9.2; remove # begin/rescue clause in later versions rescue RuntimeError int_id end end @m_listctrl3 = finder.call("m_listCtrl3") @m_listctrl3.extend(TestListCtrl) if self.class.method_defined? "on_init" self.on_init() end end end - testlistctrl.rb (main) #!/usr/bin/ruby require 'rubygems' require 'wx' require 'testlistctrlbase.rb' module TestListCtrl def on_init insert_column(0, 'first') insert_column(1, 'second') self.item_count = 10 end def on_get_item_text(item, col) 'foo' end end class TestFrame < TestFrameBase def initialize super end def on_init @m_listctrl3.on_init # @m_listctrl3.refresh_items(0, 9) end end class TestApp < Wx::App def on_init f = TestFrame.new.show return true end end TestApp.new.main_loop Regards, Ken Uraya -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Tue Apr 20 00:25:21 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Tue, 20 Apr 2010 11:25:21 +0700 Subject: [wxruby-users] how to save window position on frame move? Message-ID: Dear All, I want my app to save it's window position so next time I run it, the window will place at the last position But I cannot use close event to save position since it is a tray application I plan to use on move window but cannot seem to find any documentation about it Any suggestion? Regards Hendra -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Tue Apr 20 11:29:04 2010 From: mario at ruby-im.net (Mario Steele) Date: Tue, 20 Apr 2010 08:29:04 -0700 Subject: [wxruby-users] how to save window position on frame move? In-Reply-To: References: Message-ID: It's easy to save the position of your window. And technically, you can use the onClose event, even with it being a Tray App. The method in which this works, is that you would need to return false from your window to prevent the window from being destroyed. An example of this: class MyWin < Wx::Frame def initialize() super(nil,-1,"Sample Hide, not close") evt_close(self,:on_close) end def on_close(event) @pos = self.position self.hide return false end end HTH, Mario On Mon, Apr 19, 2010 at 9:25 PM, hendra kusuma wrote: > Dear All, > > I want my app to save it's window position > so next time I run it, the window will place at the last position > But I cannot use close event to save position > since it is a tray application > > I plan to use on move window > but cannot seem to find any documentation about it > > Any suggestion? > > Regards > Hendra > -- > Suka linux? > Kunjungi blog saya http://penguinroad.blogspot.com > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant 3 - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.iftcommand.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Tue Apr 20 21:59:44 2010 From: penguinroad at gmail.com (penguinroad) Date: Wed, 21 Apr 2010 08:59:44 +0700 Subject: [wxruby-users] how to save window position on frame move? In-Reply-To: References: Message-ID: I already know how to save the position but the reason for me not to use on_close event is because I am making a simple and personal desktop calendar with todo and event reminder and I am not likely to close it before I shutdown my computer therefore I need another event to save it what comes in my mind is an event when a window is moved but I cannot seem to find it any other idea? On Tue, Apr 20, 2010 at 10:29 PM, Mario Steele wrote: > It's easy to save the position of your window. And technically, you can > use the onClose event, even with it being a Tray App. > > The method in which this works, is that you would need to return false from > your window to prevent the window from being destroyed. > > An example of this: > > class MyWin < Wx::Frame > def initialize() > super(nil,-1,"Sample Hide, not close") > evt_close(self,:on_close) > end > > def on_close(event) > @pos = self.position > self.hide > return false > end > end > > HTH, > > Mario > On Mon, Apr 19, 2010 at 9:25 PM, hendra kusuma wrote: > >> Dear All, >> >> I want my app to save it's window position >> so next time I run it, the window will place at the last position >> But I cannot use close event to save position >> since it is a tray application >> >> I plan to use on move window >> but cannot seem to find any documentation about it >> >> Any suggestion? >> >> Regards >> Hendra >> -- >> Suka linux? >> Kunjungi blog saya http://penguinroad.blogspot.com >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > > -- > Mario Steele > Lieutenant 3 - Geo 99 > XO - STO IFT Fleet > Chief Engineer - Second Life > http://www.iftcommand.com > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Apr 21 02:01:53 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 21 Apr 2010 07:01:53 +0100 Subject: [wxruby-users] how to save window position on frame move? In-Reply-To: References: Message-ID: <4BCE94D1.2050603@pressure.to> Hi Hendra On 21/04/2010 02:59, penguinroad wrote: > I already know how to save the position > but the reason for me not to use on_close event is > because I am making a simple and personal desktop calendar > with todo and event reminder > and I am not likely to close it before I shutdown my computer > therefore I need another event to save it Maybe Wx::ActivateEvent - http://wxruby.rubyforge.org/doc/activateevent.html You could use the evt_activate_app to detect when the whole application loses focus, and serialise the window state then. I have not tried this with tray-based apps, but there is a sample in etc/ that you could have a look at and try easily. best alex From alex at pressure.to Wed Apr 21 02:21:53 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 21 Apr 2010 07:21:53 +0100 Subject: [wxruby-users] how to display ListCtrl_virtual using xrcise In-Reply-To: References: Message-ID: <4BCE9981.2010200@pressure.to> On 18/04/2010 13:10, Ken Uraya wrote: > I'm trying to display text in a ListCtrl_virtual using xrcise. > To display text, I implemented on_get_item_text() method in TestListCtrl > module. > However, no text displayed in my list. > I'd appreciate it if you could teach me how to display text. > I can't test this right now, but looking over your code, a couple of things to try: - don't use on_init to do start up - just call the superclass constructor then carry on. - you may need to do set_column_width to set out the columns a From penguinroad at gmail.com Wed Apr 21 22:01:02 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Thu, 22 Apr 2010 09:01:02 +0700 Subject: [wxruby-users] how to save window position on frame move? In-Reply-To: <4BCE94D1.2050603@pressure.to> References: <4BCE94D1.2050603@pressure.to> Message-ID: On Wed, Apr 21, 2010 at 1:01 PM, Alex Fenton wrote: > Hi Hendra > > > On 21/04/2010 02:59, penguinroad wrote: > >> I already know how to save the position >> but the reason for me not to use on_close event is >> because I am making a simple and personal desktop calendar >> with todo and event reminder >> and I am not likely to close it before I shutdown my computer >> therefore I need another event to save it >> > > Maybe Wx::ActivateEvent - > http://wxruby.rubyforge.org/doc/activateevent.html > > You could use the evt_activate_app to detect when the whole application > loses focus, and serialise the window state then. I have not tried this with > tray-based apps, but there is a sample in etc/ that you could have a look at > and try easily. > > Thank you for the pointer I found Wx::MoveEvent and it works exactly as I need Thank you -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Wed Apr 21 23:51:09 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Thu, 22 Apr 2010 10:51:09 +0700 Subject: [wxruby-users] some question, calendar and notification Message-ID: Dear All, I have some question regarding on wxwidget Is there a way to add tooltip into a date in calendarctrl? Is there a build in way to do notification like notification in ubuntu or in thunderbird? Regards, Hendra -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Thu Apr 22 00:02:50 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Thu, 22 Apr 2010 11:02:50 +0700 Subject: [wxruby-users] some question, calendar and notification In-Reply-To: References: Message-ID: On Thu, Apr 22, 2010 at 10:51 AM, hendra kusuma wrote: > Dear All, > I have some question regarding on wxwidget > > Is there a way to add tooltip into a date in calendarctrl? > > Is there a build in way to do notification like notification in ubuntu or > in thunderbird? > > More question Is there a way to make window shows on desktop always on bottom and never be minimized even when we click show desktop icon? -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Thu Apr 22 02:12:38 2010 From: alex at pressure.to (Alex Fenton) Date: Thu, 22 Apr 2010 07:12:38 +0100 Subject: [wxruby-users] how to save window position on frame move? In-Reply-To: References: <4BCE94D1.2050603@pressure.to> Message-ID: <4BCFE8D6.5050101@pressure.to> On 22/04/2010 03:01, hendra kusuma wrote: > Thank you for the pointer > I found Wx::MoveEvent > and it works exactly as I need Good, I'm glad it works. I was cautious about suggesting MoveEvent because it occurs frequently when a Frame is, say, being dragged about by its title bar. So it's not desirable to do lengthy operations (e.g. write to a File) each time it occurs. best alex From penguinroad at gmail.com Thu Apr 22 02:23:03 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Thu, 22 Apr 2010 13:23:03 +0700 Subject: [wxruby-users] how to save window position on frame move? In-Reply-To: <4BCFE8D6.5050101@pressure.to> References: <4BCE94D1.2050603@pressure.to> <4BCFE8D6.5050101@pressure.to> Message-ID: Well, thats exacly what I do write 2 lines to a file to save x and y position of my window I don't know it it occurs frequently but somehow it do just fine thanks On Thu, Apr 22, 2010 at 1:12 PM, Alex Fenton wrote: > On 22/04/2010 03:01, hendra kusuma wrote: > >> Thank you for the pointer >> I found Wx::MoveEvent >> and it works exactly as I need >> > > Good, I'm glad it works. I was cautious about suggesting MoveEvent because > it occurs frequently when a Frame is, say, being dragged about by its title > bar. So it's not desirable to do lengthy operations (e.g. write to a File) > each time it occurs. > > > best > alex > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Apr 23 12:10:28 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Fri, 23 Apr 2010 18:10:28 +0200 Subject: [wxruby-users] Icon questions Message-ID: I'm working on my first wxRuby project. Because the example files are on a different drive, I copied the wxruby.png icon file to the same directory as my ruby program. The titlebar icon and Taskbar icon (I'm on a WinXP machine) showed up fine. When I substitute an alternate 32x32 .png image, it doesn't: # Give the frame an icon. Try an alternate to the default wxruby icon icon_file = File.join( File.dirname(__FILE__)+"/", "slate.png") # icon_file = File.join( File.dirname(__FILE__)+"/", "wxruby.png") self.icon = Wx::Icon.new(icon_file) When I open wxruby.png in Photoshop Elements, it seems a normal 32x32 png file with transparency. If I save slate.png in the .ico format, WinXP does use it, but seems to shrink it to 24x24 or maybe 16x16 or something smaller in both the toolbar and Taskbar, but shows a very clear and crisp image in the Task Switcher (alt-Tab), which is clearly larger than the toolbar icon. (In other words, it looks like the Task Switcher is using it at 32x32.) I know that icons in various sizes are needed, and the art folder in the examples has the wxRuby image in 64x64, 128x128 and 256x256 sizes in addition to the 32x32 .png. I've also read somewhere that WinXP expects a 16x16 for the toolbar. When people say "use .png for the icon" so that it can be used cross-platform, there seems to be another layer of information I'm missing. Where can I find out more about what wxRuby or wxWidgets expects? Thanks, Roger Sperberg rsperberg at gmail -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Apr 23 13:01:48 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Fri, 23 Apr 2010 19:01:48 +0200 Subject: [wxruby-users] Mac OS X 10.5 installation and cross-platform questions Message-ID: <628094d70efa94761b03f7924b3ab7b5@ruby-forum.com> I'm just beginning to learn wxRuby. I'm working on a WinXP sp3 machine, and I expect to test Linux using VirtualBox and Ubuntu and to test Mac OS X 10.5 on my wife's Mac mini. On her Mac, I got Ruby 1.9.1p376 installed following Dan Benjamin's instructions at http://hivelogic.com/articles/ruby-rails-leopard (Yes, "which ruby" yields /usr/local/bin/ruby and "ruby -v" results in ruby 1.9.1p376 (2009-12-07 rev 26041) [i386_darwin9.8.0] ) I then followed his instructions for installing RubyGems. And then installed the wxRuby gem. My simple program creating 4 tall, colored buttons (I've put a zip of this at http://sites.google.com/site/thecalculatorproject/projects/adding-machines/machine-that-adds-1s-2s---code-listing if you want to see it) worked exactly as expected on WinXP. I'm attaching a screen capture showing what it looks like on Windows. On OS X, the program runs performs the few simple actions I built in, but it has almost none of the button colors and sizes spec'd. (Sorry I don't have a capture of the result.) Since this is my first trial, I haven't really thought through the best way to represent a design that Windows, MacOS and Linux can all represent unambiguously. So if you look at my code and think, "Wow, that's not the way to do this!" I won't be surprised. However, I'm not really sure I have got wxRuby installed properly on the Mac. Do I need to install wxWidgets independently? (I did install wxWidgets separately on WinXP.) Since I have only sporadic access to this Mac, I haven't yet tried running the example files and comparing the results with what I see on Windows (haven't gotten to Ubuntu yet either). Any thoughts on this process so far? Any obvious missteps I ought to correct? Any guidance on how to confirm I have got everything needed for things to run properly? Thanks, Roger Sperberg rsperberg at gmail Attachments: http://www.ruby-forum.com/attachment/4685/adding_machine_w_tall_buttons_v11.png -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Apr 23 13:31:17 2010 From: alex at pressure.to (Alex Fenton) Date: Fri, 23 Apr 2010 18:31:17 +0100 Subject: [wxruby-users] Mac OS X 10.5 installation and cross-platform questions In-Reply-To: <628094d70efa94761b03f7924b3ab7b5@ruby-forum.com> References: <628094d70efa94761b03f7924b3ab7b5@ruby-forum.com> Message-ID: <4BD1D965.4090204@pressure.to> Hi Roger On 23/04/2010 18:01, Roger Sperberg wrote: > (Yes, "which ruby" yields /usr/local/bin/ruby and "ruby -v" results in > ruby 1.9.1p376 (2009-12-07 rev 26041) [i386_darwin9.8.0] ) > If you've done this, and ruby -rubygems runs a wxruby script, then you've almost certainly installed wxRuby and ruby correctly. > On OS X, the program runs performs the few simple actions I built in, > but it has almost none of the button colors and sizes spec'd. (Sorry I > don't have a capture of the result.) > > Since this is my first trial, I haven't really thought through the best > way to represent a design that Windows, MacOS and Linux can all > represent unambiguously. > I haven't looked at your code, just at the screenshot. A few comments about the approach wxRuby takes, inheriting from wxWidgets might be helpful: in general, it allows the application designer to describe what each interactive element (eg button) should be doing, and where they should be - in relation to one another. wxRuby/Widgets takes this expression of intention and uses each OS's native GUI toolkit to represent it visually on the screen. On Mac, push buttons are always that apple-y grey; frame close/min/max buttons are always on the top left and are red/yellow/green. That's what the Apple UI guidelines say; that's what Apple's UI toolkit allows. It happens that Windows is more permissive/incoherent, depending on your view, so the button styles you've set actually apply. It really depends what kind of interactive app you're trying to create. wxRuby is a way of creating apps that will look "right", function "right" and interact with the wider desktop in the "right" way on different platforms. They seek to build on users' existing experience of how GUI appliccations work to provide ease of use. Though it is very flexible and customisable, it's less well suited to apps which seek to create a very specific visual feel (down to exact pixels and button shapes). There are important times for such apps - but eg Flash is a more tailored environment for building them. hth alex From lists at ruby-forum.com Fri Apr 23 14:18:40 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Fri, 23 Apr 2010 20:18:40 +0200 Subject: [wxruby-users] Mac OS X 10.5 installation and cross-platform questions In-Reply-To: <4BD1D965.4090204@pressure.to> References: <628094d70efa94761b03f7924b3ab7b5@ruby-forum.com> <4BD1D965.4090204@pressure.to> Message-ID: Alex Fenton wrote: > Hi Roger > > On 23/04/2010 18:01, Roger Sperberg wrote: >> (Yes, "which ruby" yields /usr/local/bin/ruby and "ruby -v" results in >> ruby 1.9.1p376 (2009-12-07 rev 26041) [i386_darwin9.8.0] ) >> > > If you've done this, and ruby -rubygems runs a wxruby > script, then you've almost certainly installed wxRuby and ruby > correctly. Thanks for the confirmation! >> I haven't really thought through the best >> way to represent a design that Windows, MacOS and Linux can all >> represent unambiguously. >> > It really depends what kind of interactive app you're trying to create. > wxRuby is a way of creating apps that will look "right", function > "right" and interact with the wider desktop in the "right" way on > different platforms. ... Though it is very > flexible and customisable, it's less well suited to apps which seek to > create a very specific visual feel (down to exact pixels and button > shapes). There are important times for such apps - but eg Flash is a > more tailored environment for building them. > > hth > alex Absolutely. My comments aren't a complaint about wxWidgets. In fact, what I am trying to do in this simple program is reduce a calculator to its bare essentials: two number keys (to simplify troubleshooting ? first number added or second?), plus and equals; while still resembling the calculator that will be the final version. In earlier versions I've made, I used bitmap images for the keys. However, using standard buttons seemed simpler as an overall process to explain (and, of course, coloring them and changing their shape to make them more calculator-like so the kids following my steps wouldn't get discouraged from the first pass through the problem). Obviously if OS X interprets the appearance instructions this differently for the standard button widget, I'd better rethink the "example reduced to its simplest parts." For the complete calculator, I expect to use Wx::BitmapButton and want only for the general look to be the same, not identical results on different platforms. Thanks for taking the time to respond to my post. Roger rsperberg at gmail -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Apr 23 14:23:16 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Fri, 23 Apr 2010 20:23:16 +0200 Subject: [wxruby-users] wxRuby documentation suggestion: include screen captures Message-ID: I was thinking that screen captures would benefit many of the explanations in the documentation of wxRuby. And as I work my way through different portions of the API, I'm willing to make some of those captures. Who is the best person to contact about this? Thanks! Roger rsperberg at gmail -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Apr 23 16:31:27 2010 From: alex at pressure.to (Alex Fenton) Date: Fri, 23 Apr 2010 21:31:27 +0100 Subject: [wxruby-users] Icon questions In-Reply-To: References: Message-ID: <4BD2039F.2080609@pressure.to> On 23/04/2010 17:10, Roger Sperberg wrote: > I know that icons in various sizes are needed, and the art folder in the > examples has the wxRuby image in 64x64, 128x128 and 256x256 sizes in > addition to the 32x32 .png. I've also read somewhere that WinXP expects > a 16x16 for the toolbar. > > When people say "use .png for the icon" so that it can be used > cross-platform, there seems to be another layer of information I'm > missing. Where can I find out more about what wxRuby or wxWidgets > expects? > In the documentation, though it's nowhere that someone new and asking the very sensible questions that you ask would find it. The same question puzzled me for a long time using wxWidgets, until I pretty much stumbled on (part of) the answer. Frame inherits it #set_icon (or #icon=) method from Wx::TopLevelWindow. TLW also has a method #set_icons/#icons= which accepts an object of class Wx::IconBundle. IB can contain multiple icons at different sizes, for use in different places. http://wxruby.rubyforge.org/doc/toplevelwindow.html#TopLevelWindow_seticons The next question you might have on icons, since you're trying out on OS X, is why set_icon(s) doesn't affect an app's Dock icon. This is because wxWidget's treats the OS X Dock as analogous to the system tray on Windows, so you use Wx::TaskBarIcon instead. Under Apple's interface guideliens, the area next to the clock is reserved for system apps - not user apps. So the answer to your question is "in several different places". This ml is happy to help, and I've learnt a vast amount from responses to wxPython and wxWidgets questions. A search term with class and method names according to C++ / Python conventions can be fruitful, eg: http://www.google.co.uk/search?q=wxframe+SetIcon+different+sizes best alex From alex at pressure.to Fri Apr 23 16:45:34 2010 From: alex at pressure.to (Alex Fenton) Date: Fri, 23 Apr 2010 21:45:34 +0100 Subject: [wxruby-users] wxRuby documentation suggestion: include screen captures In-Reply-To: References: Message-ID: <4BD206EE.40701@pressure.to> On 23/04/2010 19:23, Roger Sperberg wrote: > I was thinking that screen captures would benefit many of the > explanations in the documentation of wxRuby. > That's a great idea ... > And as I work my way through different portions of the API, I'm willing > to make some of those captures. > > Who is the best person to contact about this? > ... and thanks for your willingness to help. It's so good that it's already being done for wxWidgets; see, for example: http://docs.wxwidgets.org/trunk/classwx_button.html The current wxRuby API documentation is stored in Textile, in docs/textile in the distribution. This is being maintained for 2.0 but not really developed - patches for text mistakes are welcome on this list, or (preferably) wxruby-development or the patch tool on Rubyforge - a maintainer will pick them up. But I don't think this will help with images - the best way might either be to participate in the wider wxWidgets effort (hopefully, wxRuby will integrate the new upstream docs), or to make some wiki pages on wxruby.rubyforge.org. thanks again alex From alex at pressure.to Fri Apr 23 16:49:18 2010 From: alex at pressure.to (Alex Fenton) Date: Fri, 23 Apr 2010 21:49:18 +0100 Subject: [wxruby-users] Mac OS X 10.5 installation and cross-platform questions In-Reply-To: References: <628094d70efa94761b03f7924b3ab7b5@ruby-forum.com> <4BD1D965.4090204@pressure.to> Message-ID: <4BD207CE.4000505@pressure.to> On 23/04/2010 19:18, Roger Sperberg wrote: > Obviously if OS X interprets the appearance instructions this > differently for the standard button widget, I'd better rethink the > "example reduced to its simplest parts." For the complete calculator, I > expect to use Wx::BitmapButton and want only for the general look to be > the same, not identical results on different platforms. > Yes, Wx::BitmapButton is the way to go, I think. The fact that all Windows (widgets) have a colour= method is a bit deceptive, as it implies that it'll be honoured. As you've found OS X standard UI buttons (and lots of others) don't have any concept of a "colour", or indeed of a "size" (other than "Normal", "Small" and "Mini" scale - which are accessed differently) best alex From lists at ruby-forum.com Fri Apr 23 18:21:30 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Sat, 24 Apr 2010 00:21:30 +0200 Subject: [wxruby-users] wxRuby documentation suggestion: include screen captures In-Reply-To: <4BD206EE.40701@pressure.to> References: <4BD206EE.40701@pressure.to> Message-ID: Alex Fenton wrote: > The current wxRuby API documentation is stored in Textile ... > > But I don't think this will help with images - the best way might either > be to participate in the wider wxWidgets effort (hopefully, wxRuby will > integrate the new upstream docs), or to make some wiki pages on > wxruby.rubyforge.org. > > thanks again > alex You know the lay of the land, and so I'm not disputing you. But couldn't any screen capture be uploaded to, say, wxruby.rubyforge.org/img/ and referenced in the existing documentation as well as contributed to any upstream effort? Because even if the documentation is not being developed, it's all that users new to wxRuby such as myself have to rely on now. And while I'm not knowledgeable about wxRuby, even I can open a Textile document, insert a URI sandwiched between exclamation points, and check the document back into SVN without bringing the server down. :-) But I'll add some pages to the wiki about the example files as I work through them and try out their essential features in my own beginning apps. Roger rsperberg at gmail -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Apr 24 08:03:16 2010 From: lists at ruby-forum.com (Ken Uraya) Date: Sat, 24 Apr 2010 14:03:16 +0200 Subject: [wxruby-users] how to display ListCtrl_virtual using xrcise In-Reply-To: <4BCE9981.2010200@pressure.to> References: <4BCE9981.2010200@pressure.to> Message-ID: <75a2897a7211eb377aa46743bf689aac@ruby-forum.com> Hi Alex, Thank you very much for your reply. I applied your two suggestions to my program. However the result was the same. Here is my modified sample code: #!/usr/bin/ruby require 'rubygems' require 'wx' require 'testlistctrlbase.rb' module TestListCtrl def set_list_ctrl insert_column(0, 'first') insert_column(1, 'second') self.set_column_width(0, 250) self.set_column_width(1, 250) self.item_count = 10 end def on_get_item_text(item, col) 'foo' end end class TestFrame < TestFrameBase def setup @m_listctrl3.set_list_ctrl end end class TestApp < Wx::App def on_init f = TestFrame.new f.setup f.show return true end end TestApp.new.main_loop Regards, Ken Uraya -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Apr 24 15:05:31 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Sat, 24 Apr 2010 21:05:31 +0200 Subject: [wxruby-users] Mac OS X 10.5 installation and cross-platform questions In-Reply-To: <4BD207CE.4000505@pressure.to> References: <628094d70efa94761b03f7924b3ab7b5@ruby-forum.com> <4BD1D965.4090204@pressure.to> <4BD207CE.4000505@pressure.to> Message-ID: Alex Fenton wrote: > On 23/04/2010 19:18, Roger Sperberg wrote: > The fact that all > Windows (widgets) have a colour= method is a bit deceptive, as it > implies that it'll be honoured. As you've found OS X standard UI buttons > (and lots of others) don't have any concept of a "colour", or indeed of > a "size" (other than "Normal", "Small" and "Mini" scale - which are > accessed differently) > I got onto the Mac mini here and ran the program again, this time remembering to make a screen capture. (To repeat: this is the same code that is rendered in the first screen capture, from Win XP.) It is as you said. The button background colors that I used actually do show up, filling the space between the pill-shaped button and the rectangular space it occupies. Roger rsperberg at gmail Attachments: http://www.ruby-forum.com/attachment/4690/addingmachine_v11_Mac.png -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Apr 27 07:38:07 2010 From: lists at ruby-forum.com (John Bentley) Date: Tue, 27 Apr 2010 13:38:07 +0200 Subject: [wxruby-users] Loading icons on windows with icon index Message-ID: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> How do you load icons on windows in wxRuby? I know in wxWidgets you use wxIconLocation, but as far as I can see, it is not included in wxRuby. Any ideas? Thanks. -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Tue Apr 27 23:35:11 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Wed, 28 Apr 2010 10:35:11 +0700 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> Message-ID: Do you mean to load icon to top-left of a window? every window should have set_icon method to do that Regards Hendra On Tue, Apr 27, 2010 at 6:38 PM, John Bentley wrote: > How do you load icons on windows in wxRuby? I know in wxWidgets you use > wxIconLocation, but as far as I can see, it is not included in wxRuby. > Any ideas? > > Thanks. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Apr 28 05:36:49 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 28 Apr 2010 10:36:49 +0100 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> Message-ID: <4BD801B1.9010705@pressure.to> On 27/04/2010 12:38, John Bentley wrote: > How do you load icons on windows in wxRuby? I know in wxWidgets you use > wxIconLocation, but as far as I can see, it is not included in wxRuby. > Any ideas? > You can load an external icon from a file simple with Wx::Icon.new(filepath,...) If you have a Windows icon file containing multiple icons, you should be able to use Wx::IconBundle.new(filepath,...), then the method get_icon(i) to access individual icons by index. hth alex From alex at pressure.to Wed Apr 28 05:42:34 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 28 Apr 2010 10:42:34 +0100 Subject: [wxruby-users] wxRuby documentation suggestion: include screen captures In-Reply-To: References: <4BD206EE.40701@pressure.to> Message-ID: <4BD8030A.8060701@pressure.to> On 23/04/2010 23:21, Roger Sperberg wrote: > You know the lay of the land, and so I'm not disputing you. But couldn't > any screen capture be uploaded to, say, wxruby.rubyforge.org/img/ and > referenced in the existing documentation as well as contributed to any > upstream effort? > Sorry, I was being a little lazy. If we add images (which I think we would like to) we'd want them to work so that they're managed in SVN, bundled with the gems and uploaded in bulk to the server. So it'd need a few tweaks to the packaging rake scripts. But if you're willing to take snaps of 10+ classes and do the patches to the docs, I'm happy to integrate those and update the rakefiles. > Because even if the documentation is not being developed, it's all that > users new to wxRuby such as myself have to rely on now. > I agree, though it's always worth remembering that wxRuby is part of a much larger ecosystem. There is a vast amount on the web about wxWidgets and wxPython which is very helpful for Ruby. It > And while I'm not knowledgeable about wxRuby, even I can open a Textile > document, insert a URI sandwiched between exclamation points, and check > the document back into SVN without bringing the server down. :-) > :) thanks alex From alex at pressure.to Wed Apr 28 05:58:10 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 28 Apr 2010 10:58:10 +0100 Subject: [wxruby-users] some question, calendar and notification In-Reply-To: References: Message-ID: <4BD806B2.5060601@pressure.to> On 22/04/2010 04:51, hendra kusuma wrote: > Is there a way to add tooltip into a date in calendarctrl? Try something like: 1) Use evt_motion to track where the mouse is within the CalendarCtrl 2) CalendarCtrl#hit_test to work out what date is being covered 3) then Window#tooltip= / set_tooltip to set the appropriate text to show on hover. I haven't done this for CalendarCtrl but it works well with StyledTextCtrl. > Is there a build in way to do notification like notification in ubuntu > or in thunderbird? http://www.rhinocerus.net/forum/lang-ruby/66940-wx-ruby-notify-window.html Not in core wxWidgets 2.8 - I've seen it discussed. Those kind of notifications aren't part of the core UI in OS X (and maybe GNOME) - applications that have them rely on add-on frameworks eg Growl. You might use another package eg: http://segment7.net/projects/ruby/growl/ http://growl.info/documentation/developer/ruby-support.php a From lists at ruby-forum.com Wed Apr 28 07:46:17 2010 From: lists at ruby-forum.com (John Bentley) Date: Wed, 28 Apr 2010 13:46:17 +0200 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: <4BD801B1.9010705@pressure.to> References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> <4BD801B1.9010705@pressure.to> Message-ID: <0efc5d0924a2484c13039b8aba35a920@ruby-forum.com> Will that load all the icons from the file? It would be better to be able to just load one. I will be loading the icons from various system dlls so it wouldn't make sense to load all of them. Alex Fenton wrote: > On 27/04/2010 12:38, John Bentley wrote: >> How do you load icons on windows in wxRuby? I know in wxWidgets you use >> wxIconLocation, but as far as I can see, it is not included in wxRuby. >> Any ideas? >> > > You can load an external icon from a file simple with > Wx::Icon.new(filepath,...) > > If you have a Windows icon file containing multiple icons, you should be > able to use Wx::IconBundle.new(filepath,...), then the method > get_icon(i) to access individual icons by index. > > hth > alex -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Wed Apr 28 18:12:24 2010 From: mario at ruby-im.net (Mario Steele) Date: Wed, 28 Apr 2010 18:12:24 -0400 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: <0efc5d0924a2484c13039b8aba35a920@ruby-forum.com> References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> <4BD801B1.9010705@pressure.to> <0efc5d0924a2484c13039b8aba35a920@ruby-forum.com> Message-ID: If you wish to load just one Icon, create a method like this: def load_windows_icon(dll_file,icon_number) ib = Wx::IconBundle.new(dll_file) ib.get_icon(icon_number) end This will return a Wx::Icon, and the ib will be put on the garbage heap for release at the next run of the Garbage Collector. There is no slowing down between loading a single icon, and loading multiple Icons through IconBundle, as wxWidgets will utilize Win32API first, and foremost, for most GUI Operations. In the case of IconBundles, it will read the Icon Header, be it .ico, .dll, or .exe, and it will parse the most important information needed to create the IconBundle class. The actual extraction, and creation of the Icon is deferred to when you use the get_icon method on the IconBundle class. An Icon Resource could have a hundred icons in it, and it will not slow down the reading of the data. hth, Mario On Wed, Apr 28, 2010 at 7:46 AM, John Bentley wrote: > Will that load all the icons from the file? It would be better to be > able to just load one. I will be loading the icons from various system > dlls so it wouldn't make sense to load all of them. > > > Alex Fenton wrote: > > On 27/04/2010 12:38, John Bentley wrote: > >> How do you load icons on windows in wxRuby? I know in wxWidgets you use > >> wxIconLocation, but as far as I can see, it is not included in wxRuby. > >> Any ideas? > >> > > > > You can load an external icon from a file simple with > > Wx::Icon.new(filepath,...) > > > > If you have a Windows icon file containing multiple icons, you should be > > able to use Wx::IconBundle.new(filepath,...), then the method > > get_icon(i) to access individual icons by index. > > > > hth > > alex > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant 3 - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.iftcommand.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Wed Apr 28 23:30:38 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Thu, 29 Apr 2010 10:30:38 +0700 Subject: [wxruby-users] some question, calendar and notification In-Reply-To: <4BD806B2.5060601@pressure.to> References: <4BD806B2.5060601@pressure.to> Message-ID: On Wed, Apr 28, 2010 at 4:58 PM, Alex Fenton wrote: > On 22/04/2010 04:51, hendra kusuma wrote: > >> Is there a way to add tooltip into a date in calendarctrl? >> > > Try something like: > > 1) Use evt_motion to track where the mouse is within the CalendarCtrl > 2) CalendarCtrl#hit_test to work out what date is being covered > 3) then Window#tooltip= / set_tooltip to set the appropriate text to show > on hover. > > I haven't done this for CalendarCtrl but it works well with StyledTextCtrl. > > Is there a build in way to do notification like notification in ubuntu or >> in thunderbird? >> > http://www.rhinocerus.net/forum/lang-ruby/66940-wx-ruby-notify-window.html > > Not in core wxWidgets 2.8 - I've seen it discussed. Those kind of > notifications aren't part of the core UI in OS X (and maybe GNOME) - > applications that have them rely on add-on frameworks eg Growl. You might > use another package eg: > > http://segment7.net/projects/ruby/growl/ > http://growl.info/documentation/developer/ruby-support.php > > Well, I found notify http://rubygems.org/gems/notify It does what I need about notification, at least on Ubuntu (the author said it is cross platform, but I have not tried it) Also about hit_test, I don't know how to use it *hit_test*(Point pos, DateTime date = nil, DateTime::WeekDay wd = nil) I assume point is get from Point.new(event.get_x, event.get_y) But what about date? I put Time.now there and it gives me error? How should I use this? -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Apr 29 11:54:47 2010 From: lists at ruby-forum.com (Roger Sperberg) Date: Thu, 29 Apr 2010 17:54:47 +0200 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: <4BD801B1.9010705@pressure.to> References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> <4BD801B1.9010705@pressure.to> Message-ID: Alex Fenton wrote: > If you have a Windows icon file containing multiple icons, you should be > able to use Wx::IconBundle.new(filepath,...), then the method > get_icon(i) to access individual icons by index. > I apologize for asking here what I could discover on my own, but I get impatient about some things and I won't have access to a Mac till the weekend. :-) If I have a Windows icon file with multiple icons, will the Mac use those icons too? Alternatively, if I were to have a Mac icns file, does it work the same way you describe when on the Mac (instead of Windows)? And will Windows be able to access the individual icons in that file or are they inaccessible to it? >From the suggestion I've seen more than once to use .png for icons to simplify different platform use, I'm guessing these questions will be answered in the negative. Is the preferred method to use Wx::SetIcons with various sized png's if you don't know on what platform your app will be used? Thanks! Roger S rsperberg at gmail -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Apr 29 13:57:12 2010 From: lists at ruby-forum.com (John Bentley) Date: Thu, 29 Apr 2010 19:57:12 +0200 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> <4BD801B1.9010705@pressure.to> <0efc5d0924a2484c13039b8aba35a920@ruby-forum.com> Message-ID: OK, thanks. That's good to know. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Apr 29 16:52:33 2010 From: alex at pressure.to (Alex Fenton) Date: Thu, 29 Apr 2010 21:52:33 +0100 Subject: [wxruby-users] some question, calendar and notification In-Reply-To: References: <4BD806B2.5060601@pressure.to> Message-ID: <4BD9F191.30806@pressure.to> On 29/04/2010 04:30, hendra kusuma wrote: > Also about hit_test, I don't know how to use it > |*hit_test*(Point pos, > DateTime date = nil, > > > DateTime::WeekDay wd = nil)| > > I assume point is get from > Point.new(event.get_x, event.get_y) > But what about date? > I put Time.now there and it gives me error? This method should have a mapping so that it accepts a single Point argument and returns a DateTime object. This is how similar methods work in other classes, but I'm afraid I think the mapping has been missed for this class & method. Could you report it as a bug please and I'll fix for next release. thanks alex From lists at ruby-forum.com Thu Apr 29 16:54:22 2010 From: lists at ruby-forum.com (=?utf-8?Q?Hurier_M=c3=a9d=c3=a9ric?=) Date: Thu, 29 Apr 2010 22:54:22 +0200 Subject: [wxruby-users] Application focus Message-ID: <3123833ce4ed996da355979efcb03f99@ruby-forum.com> Hi there, I'm developping an application based on xmpp4r and WxRuby to download file between contacts. My application must handle incoming request and manage all the file upload proccess. Unfortunately, all proccess in Wx::App are active only if the application has the focus or receive an event. For example, I must move my cursor on the main window or click on it if I want the user interface to be refreshed (contact go online/offline). Is there a way to set that the Wx application must continue its actions allthough it has not the focus ? Thank you -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Thu Apr 29 17:09:40 2010 From: mario at ruby-im.net (Mario Steele) Date: Thu, 29 Apr 2010 17:09:40 -0400 Subject: [wxruby-users] Loading icons on windows with icon index In-Reply-To: References: <572014d5a8a19a07d1dd63107e9f83c6@ruby-forum.com> <4BD801B1.9010705@pressure.to> Message-ID: Hello Roger, On Thu, Apr 29, 2010 at 11:54 AM, Roger Sperberg wrote: > > > I apologize for asking here what I could discover on my own, but I get > impatient about some things and I won't have access to a Mac till the > weekend. :-) > Not a problem, we get quite a few questions on here, that people can't find in documentation. > If I have a Windows icon file with multiple icons, will the Mac use > those icons too? I believe that wxWidgets needs a library in order to load Widows Icon files on any other system other then Windows itself. > Alternatively, if I were to have a Mac icns file, does it work the same > way you describe when on the Mac (instead of Windows)? And will Windows > be able to access the individual icons in that file or are they > inaccessible to it? > Mac OS X uses png's, like Linux does. If you ever look in a .app bundle folder, you will often find icons are in png. > >From the suggestion I've seen more than once to use .png for icons to > simplify different platform use, I'm guessing these questions will be > answered in the negative. Is the preferred method to use Wx::SetIcons > with various sized png's if you don't know on what platform your app > will be used? > It is best to use PNG's for icons, simply for the fact that wxWidgets can load PNG's correctly on all 3 platforms. And you will find that if you load with Wx::Bitmap, or Wx::Image, you can convert it to an Icon, through Wx::Icon, which will allow the icon to be created in native format, to be used on the platform in question. And infact, any PNG, GIF, JPEG, etc, etc, can be converted to a Icon, and used where ever Wx::Icon is required. Thanks! > > Roger S > > rsperberg at gmail > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant 3 - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.iftcommand.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Thu Apr 29 17:25:31 2010 From: mario at ruby-im.net (Mario Steele) Date: Thu, 29 Apr 2010 17:25:31 -0400 Subject: [wxruby-users] Application focus In-Reply-To: <3123833ce4ed996da355979efcb03f99@ruby-forum.com> References: <3123833ce4ed996da355979efcb03f99@ruby-forum.com> Message-ID: Hello Hurier, There is two ways in which you can do this. The first method, is to use a Wx::Timer and Threads. It depends on if you are using Ruby 1.9 or Ruby 1.8 in the method in which you can execute this. If you are using Ruby 1.8 You create a Thread that will do your Xmppr processing, and then you setup a timer, that will after so many seconds or Milliseconds, does a Thread switch, to allow other ruby threads to run. You can find an example of this in my Sockets examples distributed with wxRuby. If you are using Ruby 1.9 You can simply just create the Thread, and it will auto-context switch for you, as Ruby 1.9 uses native threads, instead of Soft Threads, as with Ruby 1.8, hence for the work around provided in the sockets demo. The second method in which to implement this, is to use the evt_idle method in your initialization method for your Window class, which will call the method that handles the Xmppr processing, and occasionally checks for Events to be generated by the wxWidgets, by using Wx::App.pending? Which returns true if events are pending, otherwise false. Idle events are generated once for entering an Idle state. So, if you do nothing with your app for a second, it will generate an idle event, evt_idle will execute once, and then it will wait for new events to occur. When a new event occurs for anything, the event will fire, then it will wait for a second then generate another idle event. The timing in the above explination is only an example, and does not expressly garuntee that the idle event will execute 1 second after no other events occur. hth, Mario On Thu, Apr 29, 2010 at 4:54 PM, Hurier M?d?ric wrote: > Hi there, > > I'm developping an application based on xmpp4r and WxRuby to download > file between contacts. My application must handle incoming request and > manage all the file upload proccess. > > Unfortunately, all proccess in Wx::App are active only if the > application has the focus or receive an event. > For example, I must move my cursor on the main window or click on it if > I want the user interface to be refreshed (contact go online/offline). > > Is there a way to set that the Wx application must continue its actions > allthough it has not the focus ? > > Thank you > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant 3 - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.iftcommand.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Thu Apr 29 22:08:40 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Fri, 30 Apr 2010 09:08:40 +0700 Subject: [wxruby-users] some question, calendar and notification In-Reply-To: <4BD9F191.30806@pressure.to> References: <4BD806B2.5060601@pressure.to> <4BD9F191.30806@pressure.to> Message-ID: On Fri, Apr 30, 2010 at 3:52 AM, Alex Fenton wrote: > On 29/04/2010 04:30, hendra kusuma wrote: > >> Also about hit_test, I don't know how to use it >> |*hit_test*(Point >> pos, >> DateTime >> date = nil, >> >> >> >> DateTime::WeekDay wd = nil)| >> >> I assume point is get from >> Point.new(event.get_x, event.get_y) >> But what about date? >> I put Time.now there and it gives me error? >> > > This method should have a mapping so that it accepts a single Point > argument and returns a DateTime object. This is how similar methods work in > other classes, but I'm afraid I think the mapping has been missed for this > class & method. Could you report it as a bug please and I'll fix for next > release. > > thanks > alex > > Ok, I already submit this to bug tracker Hope to see it coming -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: