>> You really want to call get_value. Unfortunately, that''s notimplemented>> in wxRuby 0.3.0.>I found to my surprise that this method is actually working, but onlyin the>example code that comes with wxRuby one-click install for Windows.@combo.get_label seems to work for me. See sample code below. HTH, Assaph ----- CODE ----- require ''wxruby'' include Wx ID_DRIVES_BOX = 1 ID_BTN1 = 2 class TestFrame < Frame def initialize super(nil, -1, "Test App") dlgSizer = BoxSizer.new(VERTICAL) drives = `subst`.split("\n").collect {|d| md = d.match(/(.:).* => .*\\(.*)/) "#{md.captures[0]} (#{md.captures[1] })" } @drives_box = ComboBox.new(self, ID_DRIVES_BOX, "", DEFAULT_POSITION, DEFAULT_SIZE, drives) @drives_box.set_selection(0) dlgSizer.add(@drives_box, 1, ALIGN_RIGHT | ALL, 3) evt_combobox(ID_DRIVES_BOX) {on_cmbx_change} @btn_test_cmbx = Button.new(self, ID_BTN1, "Test ComboBox") evt_button(ID_BTN1) { on_cmbx_change } dlgSizer.add(@btn_test_cmbx, 1, ALIGN_RIGHT | ALL, 3) dlgSizer.add(@fileList) dlgSizer.set_size_hints(self) set_sizer(dlgSizer) set_size(Size.new(600,300)) layout() end def on_cmbx_change p @drives_box.get_label end end class TestApp < App def on_init frm = TestFrame.new set_top_window(frm) frm.centre(BOTH) frm.show(true) end end TestApp.new.main_loop
Hi Assaph,> > @combo.get_label seems to work for me. > See sample code below. >It worked for me too ! Thanks a lot for the tip and sample code. -- shanko
----- Original Message ----- From: "Mehr, Assaph (Assaph)" <assaph@avaya.com> To: "Shashank Date" <sdate@everestkc.net> Sent: Monday, May 24, 2004 6:48 PM Subject: RE: [Wxruby-users] Combo Box>> It worked for me too ! Thanks a lot for the tip and sample code. > > De nada. It''s an ''undocumented feature'' :)Wow !> I actually use the sample code to test a lot of wx stuff. My usual is to > print all the methods for an object, or print it in yaml to see the > internal structure. After that it''s just trial and error.Aha ! I was wondering how you did it... I trawled through wxWidgets and wxPython websites to get some good documentation. But none that I looked had this trick. Any more "undocumented" tricks you have learnt so far ;-) Do you know of any resource where the wx Class hierarchy is detailed out? I have seen their Class diagram on the wxWidgets site but it is a little messy and high level for me. I don;t want any fancy graphics, just a ASCII tree would do. TIA. -- shanko
> Aha ! I was wondering how you did it... I trawled through wxWidgets > and wxPython websites to get some good documentation. But none > that I looked had this trick.I usually use the c++ documentation until it breaks down :) It''s pretty good, especially with the wxPython notes.> Any more "undocumented" tricks you have learnt so far ;-)Only a few about ListCtrl. That was the most advanced control I''ve used to date. It''s mainly what listctrl can''t do...> Do you know of any resource where the wx Class hierarchy is detailedout?> I have seen their Class diagram on the wxWidgets site but it is alittle> messy and high level for me. I don;t want any fancy graphics, just a > ASCII tree would do.<shameless plug> Look at Ruby Object Graph on RubyForge: objectgraph.rubyforge.org! ;-) Zip file attached for you convenience. Unfortunately I can''t link from the HTML to the class as they use numbered pages (and not named ones). The HTML in the zip will just take you the docos home page. </shameless plug> -------------- next part -------------- A non-text attachment was scrubbed... Name: wxgraph.zip Type: application/x-zip-compressed Size: 64887 bytes Desc: wxgraph.zip Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20040525/bc8531f4/wxgraph-0001.bin
Mehr, Assaph (Assaph) wrote:> @combo.get_label seems to work for me. > See sample code below.It doesn''t work for me on Linux. Might be a Windows-specific thing. The sample always returns "" as the result, for me. Kevin
>> @combo.get_label seems to work for me.> It doesn''t work for me on Linux. Might be a Windows-specific thing.The> sample always returns "" as the result, for me.I don''t have an easy access to linux here (i.e. I''m too lazy to compile wxwidgets :). Maybe you can check the sources for a diff between the windows/linux versions of the c++ wxwidgets that wxruby relies on?
----- Original Message ----- From: "Mehr, Assaph (Assaph)" <assaph@avaya.com> To: "Shashank Date" <sdate@everestkc.net> Cc: "General discussion of wxRuby" <wxruby-users@rubyforge.org> Sent: Monday, May 24, 2004 7:58 PM Subject: RE: [Wxruby-users] Combo Box>I usually use the c++ documentation until it breaks down :) >It''s pretty good, especially with the wxPython notes.I do that too :-)> Only a few about ListCtrl. That was the most advanced control I''ve used > to date. It''s mainly what listctrl can''t do...So what is it .... I use ListBox very often. Is that the same one?> Look at Ruby Object Graph on RubyForge: objectgraph.rubyforge.org! ;-) >Zip file attached for you convenience.Cool ! Thanks ...> Unfortunately I can''t link from > the HTML to the class as they use numbered pages (and not named ones). > The HTML in the zip will just take you the docos home page.Hmmm.... so what does one do, to get the class details ? -- shanko
>> Only a few about ListCtrl. That was the most advanced control I''veused>> to date. It''s mainly what listctrl can''t do...> So what is it .... I use ListBox very often. Is that the same one?Nope, ListCtrl is the more ''sophisticated'' control. It can have both lines and columns in the display (your standard table widget). What it can''t do: resize properly if there''s something to the right of it, display two columns with icons (can only display icons in one column; maybe an MSWin issue).> Hmmm.... so what does one do, to get the class details ?Go to the first page of the docos, find the class name, click.... :-) I suggest downloading the docos. Having a local copy is just so much faster. What other details are you looking for?
Hi Assaph, ----- Original Message ----- From: "Mehr, Assaph (Assaph)" <assaph@avaya.com> To: "Shashank Date" <sdate@everestkc.net> Cc: "General discussion of wxRuby" <wxruby-users@rubyforge.org> Sent: Tuesday, May 25, 2004 10:32 PM Subject: RE: [Wxruby-users] Combo Box>> So what is it .... I use ListBox very often. Is that the same one? > > Nope, ListCtrl is the more ''sophisticated'' control. It can have both > lines and columns in the display (your standard table widget). > > What it can''t do: resize properly if there''s something to the right of > it, display two columns with icons (can only display icons in one > column; maybe an MSWin issue).Thanks for saving me a lot of time later (when I decide to use it ;-)>> Hmmm.... so what does one do, to get the class details ? > > Go to the first page of the docos, find the class name, click.... :-) > I suggest downloading the docos.What is "docos"? I could not find it even after Googling for about 10 minutes. Sorry for being a bit dense on this one.>What other details are you looking for?Something like this: www.koansoftware.com/pdf/wxClassLibrary-2.2.7.pdf Thanks, -- shanko P.S> Have you not released your package on rubyforge yet?
>> Go to the first page of the docos, find the class name, click.... :-) >> I suggest downloading the docos.> What is "docos"? I could not find it even after Googling for about > 10 minutes. Sorry for being a bit dense on this one.Sorry for that one, it''s aussie (em... Aussie == Australian) slang. Every word with more than two sylables seems to get shortened here :-). http://www.dict.org has, I think, all the slang somewhere. Docos stand for documentation. You''ll find a good index page of the wxWidgets documentation at: http://wxwidgets.org/hierarchy_stable.htm (Stable version 2.4.2).>> What other details are you looking for? > Something like this: > www.koansoftware.com/pdf/wxClassLibrary-2.2.7.pdfNever liked those kind of graphs. Reminds me too much of M$ VC++... Anyway, I haven''t seen any like it for wxWidgets 2.4.2, but than again I don''t use the c++ version (only wxruby). Seems like it needs manual editing to generate something like it. P.S> Have you not released your package on rubyforge yet? What package? If you''re talking on ObjectGraph than it''s in rubyforge CVS. I will release it as a proper gem once application gems are working better on windows (next release of the gems library, I''ve been assured).