PROPOSAL: Tk::XML 
Author Message
 PROPOSAL: Tk::XML

Hi,

I'd like to propose the modul 'Tk::XML'. It creates Tk-Widgets
from XML-Templates. eg

<?xml version="1.0"?>
<!DOCTYPE MainWindow SYSTEM "tklang.dtd">

<MainWindow name="top" geometry="150x120">
 <Label name="hello_world_label" text="Hello World!" pack="side=top"/>
 <Button name="close_button" text="Close" command="sub { exit 0; }"
pack="side=bottom"/>
</MainWindow>

Will create a 'Hello World!'-Window with the following code:

use Tk;
use Tk::XML;

my $tkxml = new Tk::XML(XMLfile => './file.xml');
$tkxml->paint_windows;

MainLoop;

What's your Oppionion about it? Requirements are Tk, XML::Parser, XML::DOM.

--
Greets,
 CK



Sun, 18 Apr 2004 21:48:06 GMT  
 PROPOSAL: Tk::XML

Quote:

> Hi,

> I'd like to propose the modul 'Tk::XML'. It creates Tk-Widgets
> from XML-Templates. eg

[...]

> What's your Oppionion about it? Requirements are Tk, XML::Parser, XML::DOM.

This would be neat. Have you considered using existing XML DTDs for
GUIs (I think there is Mozilla thing, and Glade is also storing the
information as XML, but it's maybe too Gtk-centered)?

Also it would be nice to use this module also for pseudo widgets. If
the XML file foo.xml contains the description for a frame widget, the
user should be able to write:

    $mw = new MainWindow;
    $mw->XML(-file => "foo.xml")->pack;

and get the frame packed into his mainwindow.

Regards,
        Slaven

--

    tksm - Perl/Tk program for searching and replacing in multiple files
    http://ptktools.sourceforge.net/#tksm



Mon, 19 Apr 2004 00:42:46 GMT  
 PROPOSAL: Tk::XML

Quote:

> This would be neat. Have you considered using existing XML DTDs for
> GUIs (I think there is Mozilla thing, and Glade is also storing the
> information as XML, but it's maybe too Gtk-centered)?

Yes, I did, but the mozilla ressources are very mozilla specific and
the glade files are really gtk specific.

Quote:
> Also it would be nice to use this module also for pseudo widgets. If
> the XML file foo.xml contains the description for a frame widget, the
> user should be able to write:

>     $mw = new MainWindow;
>     $mw->XML(-file => "foo.xml")->pack;

> and get the frame packed into his mainwindow.

This is implemented as follows:

my $top = new MainWindow;
my $top = new Tk::XML(XMLfile => 'file.xml', TopLevelWidget => $top);

$top can even be a Frame, a Toplevel-Widget and any other frame-widget.

Regards,
 CK

--
s s^s<DATA>se;s (([^\s]))(ord($1)%2?
chr(ord($1)-5):chr(ord($1)-3))sieg;s s^s$_see;
__END__
uwlsy%*Sr%kqdphv%yr%AFN4%dy%zzzyhfm3ihC*1'as'>



Mon, 19 Apr 2004 22:11:01 GMT  
 PROPOSAL: Tk::XML

[...]

Quote:

> > Also it would be nice to use this module also for pseudo widgets. If
> > the XML file foo.xml contains the description for a frame widget, the
> > user should be able to write:

> >     $mw = new MainWindow;
> >     $mw->XML(-file => "foo.xml")->pack;

> > and get the frame packed into his mainwindow.

> This is implemented as follows:

> my $top = new MainWindow;
> my $top = new Tk::XML(XMLfile => 'file.xml', TopLevelWidget => $top);

> $top can even be a Frame, a Toplevel-Widget and any other
> frame-widget.

Then I would suggest to rename TopLevelWidget to Parent or -parent.
This seams to be standard for some Tk related functions (see some
examples in Tk.pm). And Frames are not really toplevel widgets.

Regards,
        Slaven

--

    tktimex - project time manager
    http://sourceforge.net/projects/ptktools/



Tue, 20 Apr 2004 05:41:40 GMT  
 PROPOSAL: Tk::XML
Joho,

Quote:


> [...]

>> > Also it would be nice to use this module also for pseudo widgets. If
>> > the XML file foo.xml contains the description for a frame widget, the
>> > user should be able to write:

>> >     $mw = new MainWindow;
>> >     $mw->XML(-file => "foo.xml")->pack;

>> > and get the frame packed into his mainwindow.

>> This is implemented as follows:

>> my $top = new MainWindow;
>> my $top = new Tk::XML(XMLfile => 'file.xml', TopLevelWidget => $top);

>> $top can even be a Frame, a Toplevel-Widget and any other
>> frame-widget.

> Then I would suggest to rename TopLevelWidget to Parent or -parent.
> This seams to be standard for some Tk related functions (see some
> examples in Tk.pm). And Frames are not really toplevel widgets.

Hm, I think, you're right. Ok, thanks.

Regards,
 CK

--
s s^s<DATA>se;s (([^\s]))(ord($1)%2?
chr(ord($1)-5):chr(ord($1)-3))sieg;s s^s$_see;
__END__
uwlsy%*Sr%kqdphv%yr%AFN4%dy%zzzyhfm3ihC*1'as'>



Tue, 20 Apr 2004 06:27:26 GMT  
 PROPOSAL: Tk::XML

Quote:

> I'd like to propose the modul 'Tk::XML'. It creates Tk-Widgets
> from XML-Templates. eg

[snip]

Quote:
> What's your Oppionion about it? Requirements are Tk, XML::Parser, XML::DOM.

Ideally it should behave as a SAX handler, so you aren't tied to using
XML::Parser (XML::DOM can build a tree from SAX input).


Fri, 23 Apr 2004 08:29:36 GMT  
 PROPOSAL: Tk::XML
Joho,



Quote:

>> I'd like to propose the modul 'Tk::XML'. It creates Tk-Widgets from
>> XML-Templates. eg

> [snip]

>> What's your Oppionion about it? Requirements are Tk, XML::Parser,
>> XML::DOM.

> Ideally it should behave as a SAX handler, so you aren't tied to using
> XML::Parser (XML::DOM can build a tree from SAX input).

Hmmm, why do you think so?

--
Regards,
 CK



Sat, 24 Apr 2004 14:52:46 GMT  
 PROPOSAL: Tk::XML

Quote:



>> Ideally it should behave as a SAX handler, so you aren't tied to using
>> XML::Parser (XML::DOM can build a tree from SAX input).
> Hmmm, why do you think so?

Because there are now a number of XML parsing modules (e.g. XML::LibXML)
that aren't expat-based, and in some cases they give superior performance.  
There are also a number of SAX event generators that take non-XML sources
and map them into SAX events.  It would be nice not to be stuck with a
single parser.


Sat, 24 Apr 2004 16:19:30 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. PROPOSAL: XML::Lite Light-weight, pure-perl, XML Parser

2. Tk::Graph / Tk::Plot proposal

3. PROPOSAL: XML based Make for C++, Perl, Python, Java

4. [Proposal: XML::Maker]

5. PROPOSAL: Tk::ActivityBar

6. (fwd) Re: PROPOSAL: Tk::ActivityBar

7. PROPOSAL: Tk::ActivityBar

8. PROPOSAL: Tk::FBox/getOpenFile: -filter may take CODE reference

9. module proposal proposal Text::RandomQuip

10. tk tree for xml ?

11. XML Browser with Perl-TK

12. XML::DOM: nicely indented XML?

 

 
Powered by phpBB® Forum Software