Hi, all!
I''ve just started to use wxruby under Win2K. I didn''t use
wxWindows
earlier. Can anybody explain why the status bar flickers at the top (!)
of the frame when I resize the frame and how to avoid this?
(the following code is the simplest example)
#-----------------------------------
require ''wxruby''
include Wx
class RbApp < App
def on_init
frame = MyFrame.new("Test status bar flicker")
frame.show(TRUE)
end
end
class MyFrame < Frame
def initialize(title)
super( nil,-1,title, DEFAULT_POSITION, DEFAULT_SIZE,
DEFAULT_FRAME_STYLE | CLIP_CHILDREN | NO_FULL_REPAINT_ON_RESIZE )
@status_bar = create_status_bar(3)
set_status_bar( @status_bar )
end
end
a = RbApp.new
a.main_loop
#-------------------------------------
Thanks for any answer in advance.
--
Pavel.
mailto:papushev@inp.nsk.su
Hi, wxruby users! I wrote today:> ... [skip]. Can anybody explain why the status bar flickers at the > top (!) of the frame when I resize the frame and how to avoid this? > (the following code is the simplest example) > > #----------------------------------- > require ''wxruby'' > include Wx > > class RbApp < App > def on_init > frame = MyFrame.new("Test status bar flicker") > frame.show(TRUE) > end > end > > class MyFrame < Frame > def initialize(title) > super( nil,-1,title, DEFAULT_POSITION, DEFAULT_SIZE, > DEFAULT_FRAME_STYLE | CLIP_CHILDREN | NO_FULL_REPAINT_ON_RESIZE ) > > @status_bar = create_status_bar(3) > set_status_bar( @status_bar ) > end > end > > a = RbApp.new > a.main_loop > #-------------------------------------It seems that the problem is in the function create_status_bar(). To avoid this flicker of the status bar under the frame''s title one can use: @status_bar = StatusBar.new(self, -1) @status_bar.set_fields_count( 3 ) set_status_bar( @status_bar ) instead of: @status_bar = create_status_bar(3) ( of course, "set_status_bar( @status_bar )" in my first message is absolutely unnecessary after "@status_bar = create_status_bar(3)" ) Could anybody say why create_status_bar() causes this flicker ? -- Best regards, Pavel mailto:papushev@inp.nsk.su
Pavel A. Papushev wrote:>>... [skip]. Can anybody explain why the status bar flickers at the >>top (!) of the frame when I resize the frame and how to avoid this?Very strange. I ran the code on my Linux box, and couldn''t see any flicker. So it seems to be Windows-specific. I looked at the wxRuby code for create_status_bar, and it seems to be passing everything through to wxWindows correctly. So it seems to be a quirk of wxWindows itself. I''m glad you found a workaround. Kevin