search for: on_init

Displaying 20 results from an estimated 144 matches for "on_init".

Did you mean: con_init
2007 Jun 28
2
Keeping GUI responsive while processing data
...hile its doing the processing and output the entire GUI freezes and looks like crap for about 5 seconds. Basically I''m looking for an easy way to avoid this so the end user doesnt freak out and think the program crashed or anything. I found this code in the thread mentioned above: def on_init t = Wx::Timer.new(self, 55) evt_timer(55) { Thread.pass } t.start(100) which would be used in the on_init of the main App. I understand what it is doing (creates a 100ms timer which calls Thread.pass every iteration), but I don''t understand how this can help the problem....
2009 Nov 28
1
'Are you sure?' custom dialog not exiting cleanly
...You can use wxsugar (xrcise) to try out this mini program if you wish to create sample1.rb . Thank you. -Philip =========== asample1.rb ==================================================== require ''wx'' require ''sample1.rb'' class DIA_Frame < DiaFrame def on_init set_affirmative_id(Wx::ID_YES) set_escape_id(Wx::ID_NO) end end class Main_Frame < MainFrame def on_init evt_close { confirm_closure } evt_button(@m_butexit) {self.close} end def confirm_closure dlg = DIA_Frame.new if(dlg.show_modal==Wx::ID_YES) then d...
2006 Dec 06
0
[ wxruby-Bugs-7131 ] Stock colours (eg Wx::WHITE) are not available before App#on_init
...orge.org/tracker/?func=detail&atid=218&aid=7131&group_id=35 Category: Incorrect behavior Group: None Status: Open Resolution: None Priority: 3 Submitted By: Alex Fenton (brokentoy) Assigned to: Kevin Smith (qualitycode) Summary: Stock colours (eg Wx::WHITE) are not available before App#on_init Initial Comment: The stock colour constants eg Wx::WHITE, Wx::BLUE are initialized by a call to wxInitializeStockObjects in %init of Wx::App (see swig/App.i) However, this means they are only available after an application is started. In the old wxruby 0.6.0 they were available as soon as the wxr...
2006 Aug 24
5
TreeCtrl background?
...default, and when I try to set the default style I get the error: TestTextCtrl.rb:15:in `set_default_style'': undefined method `'' for #<Wxruby2::TextCtrl:0x360a0c4> (NoMethodError) from TestTextCtrl.rb:15:in `initialize'' from TestTextCtrl.rb:24:in `on_init'' from TestTextCtrl.rb:30 Using the following (probably overly verbose) program: require ''wx'' include Wx class MyFrame < Frame def initialize(title) super(nil, -1, title) @top_sizer = BoxSizer.new( Wx::VERTICAL ) @panel = Panel.new(self) @p...
2007 Apr 29
8
wxruby unfriendly to other threads?
I''ve seen a few e-mails about multithreading with respect to wxruby but nothing recent. Unless I''m mistaken, and that may be, there still appear to be problems. The following code seems to hang my spawned thread in favor of the wxruby event loop: Thread.new do puts "in thread" loop do sleep 5 puts "looping" end end puts "main
2007 Jan 04
3
grid control example doesn''t work on osx.4
Hi, I am trying to use wxruby2-preview (0.0.38) on my intel macbook running os10.4.8. I am having a beast of a time running the examples in the tutorials. The super basic frame example worked but the simple grid tutorial bombs with the following message: ------ [WhiteGhost:~/tmp/wxStff] hjw$ ruby ./grid.rb /usr/local/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.38-i686-
2005 Apr 03
4
BusyCursor probs in 0.6
...out. To illustrate, I have taken the nothing.rbw sample app, and added a couple of lines to it, so the full code now reads: require ''wxruby'' include Wx class MyFrame < Wx::Frame def initialize(title) super(nil, -1, title) end end class NothingApp < Wx::App def on_init frame = MyFrame.new("Minimal wxRuby App") frame.show BusyCursor.new { message_box("This is a control sample", "About Controls") } end end a = NothingApp.new a.main_loop() ----------------------- However, the message_box line is never executed and the prog...
2009 Jan 29
4
Help understanding EVERYTHING
Team, I am trying to learn a GUI for Ruby and I picked wxRuby. The problem is that I am kind of slow learning this and I now feel frustrated after trying for about at least 7 hours. I am trying to design a simple Sudoku 9x9 grid to display numbers, 1 - 9, using buttons. I posted a question on Ruby forum ruby-talk and a gentleman, Alex Fenton, answered my questions. Alex gave me what appear to be
2004 Dec 31
5
catch keystrokes
is it possible to intercept keystrokes using wxruby?
2007 Oct 03
9
WxRuby Newbie Application Hanging
I have a WxRuby application that takes a few inputs from the user and uses that information to search through a large file for matches. The application works very well, with one exception. If I click anywhere in the frame while the application is searching through the long file, the application hangs. Has anyone experienced anything similar to this? Any suggestions on how I can fix this? Thanks
2005 Aug 17
7
Volunteer requested: Implement SplitterWindow
...ork/wxruby2$ cat samples/testsplitter.rb require ''wx'' include Wx class MyFrame < Frame def initialize(title,pos,size,style=DEFAULT_FRAME_STYLE) super(nil,-1,title,pos,size,style) splitter = SplitterWindow.new(self, -1) end end class RbApp < App def on_init frame = MyFrame.new("Spliter Tester",Point.new(50, 50), Size.new(450, 340)) frame.show(TRUE) end end a = RbApp.new a.main_loop() kevins@aria:~/work/wxruby2$ ruby samples/testsplitter.rb Our Initialize was called Their Initialize returned 1 samples/testsplitter.rb:8:in `init...
2007 Oct 04
1
wxRuby: MemoryDC problems...
...first, then using Wx::DC#draw_bitmap to copy it to a Wx::Window. But I get the following error: C:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.1-i386-mswin32/lib/wx/classes/bitmap.rb:18:in `draw'': uninitialized constant Wxruby2::Bitmap::MemoryDC (NameError) from dc_draw_line.rb:30:in `on_init'' ... What am I doing wrong? Is MemoryDC not implemented yet in WxRuby 1.9.1? It''s in the documentation, but I know large chunks of that are auto-generated... My code is below. Any advice would be most appreciated! -Jay gems_loaded = false begin require ''...
2006 Aug 24
0
Re: TextCtrl background? (was TreeCtrl background?)
...within the SetDefaultStyle method and find where it is crashing. The error in Mac OS X is: test.rb:15:in `set_default_style'': undefined method `'' for #<Wxruby2::TextCtrl:0x55832c> (NoMethodError) from test.rb:15:in `initialize'' from test.rb:24:in `on_init'' from test.rb:30 Sean On 8/23/06, Mark Ping <wxruby@roadq.com> wrote: > On my windows build, I just noticed that the background of my TextCtrl''s > is grey by default, and when I try to set the default style I get the error: > > TestTextCtrl.rb:15:in `se...
2007 Aug 23
7
TaskBarIcon gives Typerror
...inks. Do you know any good website or book about wxruby? My problem at the moment is, I wanna test the TaskBarIcon on Gnome and so I did: #!/usr/bin/env ruby $Verbose=true require ''rubygems'' require ''wx'' include Wx class MinimalApp < App def on_init mytask = TaskBarIcon.new mytask.set_icon(''shutdown.svg'',''thats my tooltip'') end end MinimalApp.new.main_loop #eof the doc tells about set_icon: Boolean set_icon(Icon icon, String tooltip) Sets the icon, and optional tooltip tex...
2007 Oct 13
3
Newbie can''t get sample/etc/wizard.rb to work
...36877056] Correct parameters are: title (String) bitmap (Wxruby2::Bitmap) pos (Wxruby2::Point) size (Wxruby2::Size) style (Fixnum) from wizard.rb:37:in `new'' from wizard.rb:37:in `initialize'' from wizard.rb:70:in `new'' from wizard.rb:70:in `on_init'' from wizard.rb:80:in `main_loop'' from wizard.rb:80 What am I missing here? Thanks -- this newbie appreciates your help! Peralta
2009 Feb 05
4
wxRuby - Segmentation fault
...appy to run this and a few other tests. Also, if I should be posting bugs somewhere else, please let me know. Here''s a bit of code to reproduce a seg fault: ----------------------------------------------------------- require ''wx'' include Wx class MyGui < App def on_init frame = Frame.new(nil, -1, ''Seg fault'') panel = Panel.new(frame, -1) 500.times { Window.new(frame) } frame.show() end end MyGui.new.main_loop() ----------------------------------------------------------- If the number is 64 (instead of 500), it doesn...
2004 Nov 18
17
Wx::Grid Questions ...
I am trying to use a grid widget in my application, but run into a number of issues: -- Can they be placed in a panel? Or better yet, placed in sizer with other controls? I have only been able to place a grid inside a frame. -- Can you designate multiple rows (or columns) as being used for labels? -- Can you create cells that span cols (or rows)? -- What events are available to trigger on? How
2010 Jun 22
1
Stuck noobie: XRC/xrcise woes
...all("upper_bt") @lower_bt = finder.call("lower_bt") @text_box2 = finder.call("text_box2") @text_box2.extend(CaseChangeTextCtrl2) #<<<<< THIS IS THE BAD LINE THAT CAUSES THE ERROR if self.class.method_defined? "on_init" self.on_init() end end end 3) ######## Exercise.rb ######## require ''rubygems'' require ''wx'' # load in the generated code require ''my_frame'' # Mix-in for a Wx::TextCtrl module CaseChangeTextCtrl1 # con...
2007 Mar 21
4
Bug in TextCtrl constructor
Howdy, I''ve uncovered a bug in the constructor for TextCtrl (originally uncovered while using WxSugar but it appears to apply to WxRuby itself as well). Here''s the output from irb: # ------ irb(main):001:0> require ''wx''; irb(main):002:0* ctl =
2007 May 21
0
[1027] trunk/wxruby2/doc/textile/app.txtl: Ruby-specific Wx::App documentation
...<del>- </del><span class="cx"> * set and get application-wide properties; </span><span class="cx"> * implement the windowing system message or event loop; </span><span class="cx"> * initiate application processing via "App#on_init":app.html#App_oninit; </span><del>-* allow default processing of events not handled by other -objects in the application. </del><ins>+* allow default processing of events not handled by other objects in the application. </ins><span class="cx"> &lt...