# Drawing state diagram with wxruby

**URL:** <https://www.ruby-forum.com/t/drawing-state-diagram-with-wxruby/141760>\
**Category:** wxRuby\
**Created:** [June 30, 2008, 1:27pm UTC](https://www.ruby-forum.com/t/drawing-state-diagram-with-wxruby/141760 "2008-06-30T13:27:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcyeap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9fc348/32.png) [@lcyeap](https://www.ruby-forum.com/u/lcyeap)\
**Post date:** [June 30, 2008, 1:27pm UTC](https://www.ruby-forum.com/t/drawing-state-diagram-with-wxruby/141760/1 "2008-06-30T13:27:07Z")

</div>

Greetings,

I am just started to use wxruby to create GUI for my project. i need to  
draw a state diagram based on some summary file. May i know is there any  
way in wxruby that allow people to draw circle and add text on it?

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![lcyeap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9fc348/32.png) [@lcyeap](https://www.ruby-forum.com/u/lcyeap)\
**Post date:** [June 30, 2008, 1:34pm UTC](https://www.ruby-forum.com/t/drawing-state-diagram-with-wxruby/141760/2 "2008-06-30T13:34:18Z")

</div>

Lc Yeap wrote:

> I am just started to use wxruby to create GUI for my project. i need to  
> draw a state diagram based on some summary file. May i know is there any  
> way in wxruby that allow people to draw circle and add text on it?

Yes, there is. Have a look at the documentation for “device contexts”

[http://wxruby.rubyforge.org/doc/#device\_contexts](http://wxruby.rubyforge.org/doc/#device_contexts)

And also the samples in the samples/drawing

hth  
alex

---

<div class="post-metadata">

**Author:** ![lcyeap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9fc348/32.png) [@lcyeap](https://www.ruby-forum.com/u/lcyeap)\
**Post date:** [July 1, 2008, 2:25am UTC](https://www.ruby-forum.com/t/drawing-state-diagram-with-wxruby/141760/3 "2008-07-01T02:25:00Z")

</div>

Alex F. wrote:

> Lc Yeap wrote:
> 
> > I am just started to use wxruby to create GUI for my project. i need to  
> > draw a state diagram based on some summary file. May i know is there any  
> > way in wxruby that allow people to draw circle and add text on it?
> 
> Yes, there is. Have a look at the documentation for “device contexts”
> 
> [http://wxruby.rubyforge.org/doc/#device\_contexts](http://wxruby.rubyforge.org/doc/#device_contexts)
> 
> And also the samples in the samples/drawing
> 
> hth  
> alex

Hi Alex,

thanks for the useful information provided. 🙂  
I am expecting the code will generate the drawing automatically based on  
the information in a text file.  
Will continue to work on it. Hope it won’t be hard…
