# Tkxml

**URL:** <https://www.ruby-forum.com/t/tkxml/150536>\
**Category:** Ruby\
**Created:** [October 9, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/tkxml/150536 "2008-10-09T17:11:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [October 9, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/tkxml/150536/1 "2008-10-09T17:11:10Z")

</div>

Ok. How about any interest in creating Tk GUIs form an xml markup. Eg.

\<Tk:Root name=“test” title=“Test”\>

```
    <Tk:Frame name="menuframe">
            <Tk:Menubutton name="filebutton" text="File"

```

underline=“0”\>  
\<Tk:Menu name=“filemenu” tearoff=“false”\>  
\<Tk:\_add  
\_1=“command”  
label=“Open”  
command=“openDocument”  
underline=“0”  
accel=“Ctrl+O” /\>  
\<Tk:\_add  
\_1=“command”  
label=“Exit”  
command=“exitApplication”  
underline=“0”  
accel=“Ctrl+Q” /\>  
\</Tk:Menu\>  
\<Tk:\_pack side=“left” /\>  
\</Tk:Menubutton\>  
\<Tk:\_pack side=“left” /\>  
\</Tk:Frame\>

```
    <Tk:_bind
            _1="Control-o"
            _2="openDocument" />

    <Tk:_bind
            _1="Control-q"
            _2="exitApplication" />

```

\</Tk:Root\>

T.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [October 9, 2008, 5:53pm UTC](https://www.ruby-forum.com/t/tkxml/150536/2 "2008-10-09T17:53:29Z")

</div>

unsubscribe  
The contents of this e-mail are intended for the named addressee only.  
It contains information that may be confidential. Unless you are the  
named addressee or an authorized designee, you may not copy or use it,  
or disclose it to anyone else. If you received it in error please notify  
us immediately and then destroy it.

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [October 9, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/tkxml/150536/3 "2008-10-09T19:38:38Z")

</div>

On Thu, Oct 9, 2008 at 8:08 AM, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ok. How about any interest in creating Tk GUIs form an xml markup. Eg.

Why not builder-style ruby markup?

[:Root, {:name =\> ‘test’, :title =\> ‘test’},  
[:Frame, {:name =\> ‘menuframe’},  
[:Menubutton, {:name =\> ‘filebutton’, :text =\> “File”, :underline =\>  
0}, …

or even sexps

(Root [(name :test) (title “test”)]  
(Frame [(name :menuframe)]  
(Menubutton [(name :filebutton) (text “File”)]

martin

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [October 9, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/tkxml/150536/4 "2008-10-09T19:55:04Z")

</div>

On Thu, Oct 9, 2008 at 1:35 PM, Martin DeMello [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On Thu, Oct 9, 2008 at 8:08 AM, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Ok. How about any interest in creating Tk GUIs form an xml markup. Eg.

> or even sexps
> 
> (Root [(name :test) (title “test”)]  
> (Frame [(name :menuframe)]  
> (Menubutton [(name :filebutton) (text “File”)]

Or even Ruby:

Root(:name =\> :test, :title =\> "test) do  
Frame(:menuframe) do  
Menubutton(:filebutton) { text “File” }  
end  
end

---

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [October 9, 2008, 10:06pm UTC](https://www.ruby-forum.com/t/tkxml/150536/5 "2008-10-09T22:06:08Z")

</div>

On Oct 9, 1:35 pm, “Martin DeMello” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> (Root [(name :test) (title “test”)]  
> (Frame [(name :menuframe)]  
> (Menubutton [(name :filebutton) (text “File”)]

Sure one can do that. I just happen to have code laying around already  
that already handles the xml. I wrote it long ago, thinking of  
something like Glade, but for Tk instead of Gtk. I never used it  
though. So I was just wondering if anyone wanted it.

I hear Tk is going to get a native look-and-feel face-lift by the way.  
That could be interesting.

T.
