I have been experimenting with having more than one child window opened and controlled by the main_dialog window.
I have found that the child windows have to be opened in a specific order or it causes a crash.
They can be closed from the main window without having to deal with order that they were launched.

I used 3 gtkdialog examples to create the script.
I am attaching it for your comments and also to show it is doable.
Edit: fixed version attached

2window_child.tar.gz

Description

revised script to open 2 child windows and control closing from the main window as well as the child windows. Revision courtesy of thunor

thunor; Sorry... I meant "notebook" ( It`s been awhile... ).
I think you understood what I meant about Basic and XML "syntax" types.
The closing tags are not needed because the start of the next control description
ends the previous control`s description, closing`s not needed, it`s already done.

Simple, clean, easy to read and write, no messy code like XML... Right?

gtkDialog`s biggest "mess" is:
The way control properties are set is random, no straight forward one way to do it.
The Basic syntax example above uses the same format for all controls and properties.

And then there`s all the unnecessary <> tags, they do nothing to describe the control !
They are just part of the XML syntax description, but serve no purpose...

There can always be multiple input file parsers for different syntax types.
I wrote a converter for Basic to gtkDialog ( like the Basic to C converter "BaCon" ).
But it would be much better if it was contained inside of gtkDialog, then
the "crappy" XML syntax could be depreciated over a few version releases,
thus easing the transition for Puppy`s GUIs that has some folks worried.
If I understand, gtkDialog just converts it`s syntax to that of GTK+ and runs it.

These are obvious corrections that could be made...
Any of them will improve gtkDialog, you must decide:
1) If you agree with me that they are improvements.
2) If you want to do it.
3) If you think it`s worth the trouble to do it.

A common way to close an xml tag that doesn't encompass other elements is to end it with "/>" instead of "></sometag>" , but I've never bothered to try it.

If you want basic syntax for gtk, there are projects that do that.
Same goes for python, C++, c#, .net, tcl...

However, it is _possible_ to do what you are asking by conversion (this is essentially part of what a compiler does) ... you are just using tracking of multiple n * \t (pita to implement) instead of just looking for the next <tag...
In other words, it may be easier to write, but it is typically slower to parse, not that the existing parser is particularly fast, considering it _requires_ libxml2 while gtk can be built with expat (which is much smaller) and glib has its own GMarkup* xml parser - don't ask me why gtk doesn't just use it._________________Web Programming - Pet Packaging 100 & 101

Hi technosaurus; I haven`t seen any Basic to GTK+ converters other than the extra stuff
that BaCon comes with, it may be very good though. Need to look at it...
Do you have any links to other Basic to GTK+ converters like this?

Speed at parsing... Seems like it would be faster the fewer characters to read.

Still, all in all it is only a little work to write a converter, I wrote many in VisualBasic
and I`ve written a few in Bash script, like the Basic to gtkDialog I mentioned.
The gtkBasic file could be executed, or the gtkDialog file it made could be saved.
### gtkDialog should be able to produce a GTK+ executable file that`d run faster.

But as I said above, doesn`t anyone else agree that the Basic code is way
easier to read, write, and understand than the crap XML syntax ?????
That alone should be enough for everyone to like and support this idea.

And again... It is so easy for it to support several syntax types... Why not?

But as I said above, doesn`t anyone else agree that the Basic code is way easier to read, write, and understand than the crap XML syntax ?????

Well, it does seem fashionable to believe that BASIC is the root of all evil
But isn't Barry himself quite a fan of BASIC? (hence why BaCon is included)

There is also freebasic, and gtkbasic / Puppybasic - or do they only do guis via glade?_________________Classic Puppy quotes
-
root: n. the superuser or administrator account that has complete control over everything in the machine. Running as root is a taonga of Puppy Linux users.

I have been experimenting with having more than one child window opened and controlled by the main_dialog window.
I have found that the child windows have to be opened in a specific order or it causes a crash.

Hi 8-bit

You've got exported_column="1" when you've only got 1 column which attempts to extract text from a non-existent column and causes a segfault. Use exported_column="0".

[EDIT] Well done, you've unearthed bugs in the examples I found a note in the ChangeLog:

I`m only talking about Basic type syntax, not the programming language.

I intended for my suggestion to focus on advantages of clean and readable code.

And then there was my pointing out gtkDialog`s scattered way of specifying
a control`s properties, which could be easily corrected in the new syntax.
Of course the property specs should be fixed for the XML syntax also.
One format for specifying properties, easy to learn, remember, read, and write.

Thank you thunor! You are right on top of things.
I am glad that my example of opening two child windows from the main window causing a crash when not opened in a certain order was tracked to something as simple as a column value.
In my example, I changed column=1 to column=0 and no more crash.

I basically made the example to prove to myself that a child process could be more than just a dialog box after having Barry state that is what he thought.

So anyway, the code in gtkdialog was ok. It was the examples that were at fault.

I should also bring to your attention that the example script "07.02-list_actions" does not work and barring a remedy, should be removed.
When run, it taxes the processor and has to be killed to recover.

I should also bring to your attention that the example script "07.02-list_actions" does not work and barring a remedy, should be removed.
When run, it taxes the processor and has to be killed to recover.

But as I said above, doesn`t anyone else agree that the Basic code is way
easier to read, write, and understand than the crap XML syntax ?????
That alone should be enough for everyone to like and support this idea.

I don't know Basic, but from your example I can't see how the nesting of various widgets works in a clear and intuitive way (which works for me with the XML syntax). We use a lot of hbox-inside-vbox-inside-hbox kind of thing.

Note that this should be irrelevant to you: if you have a proper GUI builder it will write all the proper tags. You could also probably write a syntax file for Geany so it will auto-complete tags for you (i.e. you write "<hbox>" and it will insert a "</hbox>")._________________What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

I tried "midori" which is in /usr/local/lib/X11/mini-icons/hicolor and that showed so wherever you can use <input file icon="name"></input> you should be able to access the mini-icons. There's a Tango folder in there too but I haven't managed to get any of those to show so basically it's mini-icons and mini-icons/hicolor

gtkDialog`s biggest "mess" is:
The way control properties are set is random, no straight forward one way to do it.
...
If I understand, gtkDialog just converts it`s syntax to that of GTK+ and runs it.

These are obvious corrections that could be made...
Any of them will improve gtkDialog, you must decide:
1) If you agree with me that they are improvements.
2) If you want to do it.
3) If you think it`s worth the trouble to do it.

tag_attr (tag attributes) in the opening tag are mostly GTK properties (there are a few custom ones dealt with by Gtkdialog) and these are set by GTK after widget realization. In many cases you can actually see these being applied.

The default, variable, input etc. directives (the original author described them as directives) are for Gtkdialog and so they will be set before widget realization. There is an obvious duplication with the visible directive being equivalent to the "sensitive" GTK property, and depending upon the widget you might find that the default directive is equivalent to something, but they're necessary. There do appear to be two ways of achieving the same thing with the actions though, but people could be steered away from using the duplicates by removing them from the docs and examples. [EDIT] I forgot to mention the label directive which again is a duplication of a GTK property but its benefit is that you can't see it being applied.

So it's clear then that tag attributes are mostly GTK properties and directives are exclusively for Gtkdialog. If you've found a GTK property within the GTK+ 2 Reference Manual then you place it within the opening tag. If you want to initialise the widget with some data, declare some Gtkdialog specific properties or connect to the signals then you use the directives.

Gtkdialog does not just convert its syntax to that of GTK+ and run it. Widgets are constructed in C using the data within the XML-like structure, signals are connected and in some cases controlled to be more usable and several action functions are coded to support loading, refreshing and saving data etc. Yes, some widgets can be created with just one simple GTK function but some of them are quite complex and are involved.

I'm writing a widget reference using the wiki and you might want to have a look. I think that it will help people to be clear about what they can and can't do with a widget, and which action functions they support since the widgets that I've yet to review are mostly lacking in something.

I personally don't think that changing the XML-like syntax to a BASIC-like syntax is an "obvious correction" or will "improve Gtkdialog", but you know, that's just my opinion. You appear to be passionate about your ideas and you have your own opinion too but nobody can offer you an absolute answer to your questions.

I want to add new widgets, overhaul existing widgets, implement missing action functions, finish the wiki, write some more examples, even restructure the code so that one widget is in one file with everything in a consistent order so that I don't have to keep searching the entire session to find things. These things to me will improve Gtkdialog.

Regards,
ThunorLast edited by thunor on Sat 30 Jul 2011, 05:56; edited 1 time in total

I remembered having this little item for a while.
It is a script tester for gtkdialog that looks for matching closing tags in a script as a debugging tool.
To me, it is useful.
So I am attaching it for others that may have use for it.
It could be expanded to include more tags to look for.

I am not sure who originally created it so I do not know who to give credit too for the utility.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum