# Splashscreen showing progress

**URL:** <https://www.ruby-forum.com/t/splashscreen-showing-progress/177913>\
**Category:** wxRuby\
**Created:** [October 26, 2009, 4:51pm UTC](https://www.ruby-forum.com/t/splashscreen-showing-progress/177913 "2009-10-26T16:51:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![el-gato](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@el-gato](https://www.ruby-forum.com/u/el-gato)\
**Post date:** [October 26, 2009, 4:51pm UTC](https://www.ruby-forum.com/t/splashscreen-showing-progress/177913/1 "2009-10-26T16:51:28Z")

</div>

I’d like to use a splashscreen instead of a progress dialog. I have a  
png that I can use with Bitmap.new, and I found that I can write text to  
it, but is there any way for me to update that text once the  
splashscreen is displayed?

```auto
    def splash
      bmp = Wx::Bitmap.new(SPLASH_IMG, Wx::BITMAP_TYPE_PNG)
      bmp.draw do |dc|
        dc.set_font(Wx::Font.new(8, Wx::FONTFAMILY_SWISS,
Wx::FONTSTYLE_NORMAL, Wx::FONTWEIGHT_LIGHT))
        dc.set_text_foreground(Wx::WHITE)
        dc.draw_text('Loading...', 20, 200)
      end
      ss = Wx::SplashScreen.new(bmp,
Wx::SPLASH_CENTRE_ON_PARENT|Wx::SPLASH_TIMEOUT, 3000, nil, -1)
      # Is there any way to essentially "dc.draw_text(...)" at this
point?
      yield if block_given?
      ss.destroy
    end
```

---

<div class="post-metadata">

**Author:** ![el-gato](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e0b2c6/32.png) [@el-gato](https://www.ruby-forum.com/u/el-gato)\
**Post date:** [October 27, 2009, 1:28pm UTC](https://www.ruby-forum.com/t/splashscreen-showing-progress/177913/2 "2009-10-27T13:28:10Z")

</div>

El Gato wrote:

> I’d like to use a splashscreen instead of a progress dialog. I have a  
> png that I can use with Bitmap.new, and I found that I can write text to  
> it, but is there any way for me to update that text once the  
> splashscreen is displayed?

I can’t see anything in the wxSplashScreen API, but I expect you could  
do it by defining a subclass of SplashScreen with its own evt\_paint  
handler which just draws the bitmap, and then update it by calling  
refresh() as required, which will call the paint routine.

alex
