Forum: Ruby tkxml

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thomas S. (Guest)
on 2008-10-09 19:11
(Received via mailing list)
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.
Hyaduck, John (Guest)
on 2008-10-09 19:53
(Received via mailing list)
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.
Martin DeMello (Guest)
on 2008-10-09 21:38
(Received via mailing list)
On Thu, Oct 9, 2008 at 8:08 AM, Trans <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
Gregory B. (Guest)
on 2008-10-09 21:55
(Received via mailing list)
On Thu, Oct 9, 2008 at 1:35 PM, Martin DeMello 
<removed_email_address@domain.invalid>
wrote:
> On Thu, Oct 9, 2008 at 8:08 AM, Trans <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
Thomas S. (Guest)
on 2008-10-10 00:06
(Received via mailing list)
On Oct 9, 1:35 pm, "Martin DeMello" <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.
This topic is locked and can not be replied to.