gtkdialog1-1.4

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

gtkdialog1-1.4

#1 Post by goingnuts »

Update 2015-04-01: New release, gtkdialog1-1.4, ready.

Again: Thanks to amigo for hosting the sources here!

20150407: Attached manual - fake .gz extension - rename to gtkdialog1.html and view in "any" webbrowser.

Version 1.3:
amigo has done a great job sanitizing the package and he has also been kind to host the current and the previous sources:
Download here
Attachments
gtkdialog1.html.gz
Manual for gtkdialog1-1.4 in html formate
(56.07 KiB) Downloaded 289 times
Last edited by goingnuts on Tue 07 Apr 2015, 18:25, edited 28 times in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

I went through and did a diff -urp on all of the src directories from each tarball to its predecessor ... from 0.7.20 you can pick up at
http://code.google.com/p/gtkdialog/source/list

Edit someone downloaded the patch history before I could add the 59.0 through 59.8 patches (I mistakenly thought 58 and 59 were parallel releases ... stable/unstabe because I misread some dates)

btw the included changelog is not in order

to fix pixmap path in stringman.c

Code: Select all

	if (access(filename, R_OK) == 0)
		return filename;

-	snprintf(tmp, 127, "/usr/share/icons/Bluecurve/16x16/stock/%s",
+	snprintf(tmp, 127, "/usr/share/pixmaps/%s",
			filename);
	tmp[127] = '\0';
	if (access(tmp, R_OK) == 0)
		return strdup(tmp);
for the majority of the warnings for undefined reference to ...
the header files could all be included in gtkdialog.h (the way gtk.h does - it will make things easier in the long run) ... also this:
#ifndef HEADERFILENAME_H
#define HEADERFILENAME_H
<rest of header>
#endif

I think a lot of the unused variables are from gtk2-ectomy ... just needs a few things commented out

There were a couple of wrong number of parameters - probably from things being added/removed in gtk2 which will likely just involve removing the extra parameter or adding a NULL value per these:
http://www.gtk.org/tutorial1.2/
http://developer.gnome.org/gtk-tutorial/2.22/
Attachments
gtkff.gz
this is a work in progress - ffmpeg frontend
still isn't quite working though
(3.64 KiB) Downloaded 969 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#3 Post by goingnuts »

I haven't solved the "Gdk-WARNING **: Creating pixmap from xpm with NULL window and colormap" issue - really annoying!

But additional pacth to the "fix pixmap path in stringman.c":

in automation.c:

Code: Select all

-#define GTK_STOCK_CANCEL "/usr/share/pixmaps/gtk-cancel.xpm" 	
-#define GTK_STOCK_HELP   "/usr/share/pixmaps/gtk-help.xpm" 
-#define GTK_STOCK_NO     "/usr/share/pixmaps/gtk-no.xpm" 
-#define GTK_STOCK_OK     "/usr/share/pixmaps/gtk-ok.xpm" 
-#define GTK_STOCK_YES    "/usr/share/pixmaps/gtk-yes.xpm" 
+#define GTK_STOCK_CANCEL "gtk-cancel.xpm" 	
+#define GTK_STOCK_HELP   "gtk-help.xpm" 
+#define GTK_STOCK_NO     "gtk-no.xpm" 
+#define GTK_STOCK_OK     "gtk-ok.xpm" 
+#define GTK_STOCK_YES    "gtk-yes.xpm"  

-box1 = xpm_label_box(Widget, GTK_STOCK_OK, "OK");
+box1 = xpm_label_box(Widget, find_pixmap(GTK_STOCK_OK), "OK");

-box1 = xpm_label_box(Widget, GTK_STOCK_CANCEL, "Cancel");
+box1 = xpm_label_box(Widget, find_pixmap(GTK_STOCK_CANCEL), "Cancel");

-box1 = xpm_label_box(Widget, GTK_STOCK_HELP, "Help");
+box1 = xpm_label_box(Widget, find_pixmap(GTK_STOCK_HELP), "Help");

-box1 = xpm_label_box(Widget, GTK_STOCK_YES, "Yes");
+box1 = xpm_label_box(Widget, find_pixmap(GTK_STOCK_YES), "Yes");

-box1 = xpm_label_box(Widget, GTK_STOCK_NO, "No");
+box1 = xpm_label_box(Widget, find_pixmap(GTK_STOCK_NO), "No");
And patch to make edit widget work - in widgets.c:
IN fill_edit_by_file:

Code: Select all

+#ifdef USE_GTK2	
	  GtkTextBuffer *buffer;
+#endif

+#ifdef USE_GTK2	
	  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
	  gtk_text_buffer_set_text(buffer, filebuffer, st.st_size);
+#else
+	  gtk_text_insert( GTK_TEXT(widget), NULL, NULL, NULL, filebuffer, st.st_size );
+#endif
IN save_edit_to_file:

Code: Select all

+#ifdef USE_GTK2	
	  GtkTextBuffer *buffer;
	  GtkTextIter start, end;
+#endif

+#ifdef USE_GTK2	
	  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
	  gtk_text_buffer_get_start_iter(buffer, &start);
	  gtk_text_buffer_get_end_iter(buffer, &end);
	  text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
+#else
+	  text=gtk_editable_get_chars( GTK_EDITABLE(widget), 0, -1 );   
+#endif
So now the basis for a small editor works:

Code: Select all

#! /bin/sh
export MAIN_DIALOG='
 <vbox>
  <frame Edit>
    <edit>
      <input file>gtk_edit</input>
      <output file>new-file</output>
      <variable>EDIT</variable>
      <width>350</width><height>150</height>
    </edit>
    <hbox>
      <button>
        <label>Save as "new-file"</label>
        <action>Save:EDIT</action>
      </button>
    </hbox>
  </frame>
  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'
./gtkdlg1 --program MAIN_DIALOG
How to handle those updates? Maybe leave the original starting code as is and then when enough patches done submit a new version and keep the starting point "forever" present?
Edit: Added GTK_TEXT and GTK_EDITABLE before widget in above.

Also following patch in widget.c remove 1 warning:
IN fill_label_by_file:

Code: Select all

-gtk_label_set_text(widget, filebuffer);
+gtk_label_set_text(GTK_LABEL(label), filebuffer);
In make file "-lgdk_pixbuf -ljpeg -ltiff " can be removed - not needed...

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#4 Post by amigo »

Oh, I love it! -err, I think I do anyway. Itries to do this myself some years ago -actually from the old 'gins' program, but could never get it working enough to run...
I say i think I like it because actually I hate XML -both as a reader and a writer. Still, this excellent news for me- Count on me grabbing everything you do right for gtk1!

Edit: As a historical note, before there was the gtkdialg you already know, there was a gtkdialog for gtk1, which was a replacement for xmessage. It's actually rather attractive. You can still get it at that place ith all the gk1 stuff which has disappeared from everywhere else LOL:
http://distro.ibiblio.org/amigolinux/do ... alog-1.04/
Nice looking buttons.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#5 Post by amigo »

I hope you guys can keep the changes generally applicable... actually it would be great if your work gets up-streamed since thunor is a buddy around here...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#6 Post by technosaurus »

The pixmap warning and possible solution was referenced here:
http://mail.gnome.org/archives/gtk-list ... 00270.html
for the pixmap path glade 0.6.x uses support.c for a lot of the pixmap handling - seems pretty robust.

@amigo, I attempted to do it with gtkdialog-0.7.20 a while back myself - got it to compile, but it would load and immediately exit (now I realize it was probably just a pixmap) - I am not missing libxml either (too bad rox needs it too), but I speculate that is how the var="value" tags were added and wonder if we could do it another way (using jwm's code maybe) or somehow instead use regular tags. The obvious example is <wtitle> in this version compared to <window title="" ...> I doubt Thunor will want much to do with our patches (at least for a while), it will be enough for us to just try to catch up to his work (though I may try to make a locate replacement shell script that he could use)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#7 Post by amigo »

The number of changes so far is pretty small actually and probably manageable eventually upstream, I would think. I had to maually edit the Mkefile of course to get it to compile, but it is running at least. Could I hope that you would try to use gtk1 gdk-pixbuf loaders instead of relying on hard-coded xpm's? You know you're gonna want this thing to look as good as possible too eventually.

The thing I hate about XMl is that all the tags look alike. Unless it is prettily-formatted it just looks like gibberish.

I maintain the aine chatbot which uses a tag syntax which is pretty easy to use and read -easier than the AIML it was adapted from. Perhaps you'd want to look at that? I've made a couple of small changes to the syntax myself since I took it over. The last maintainer put a lot of work into building a tight parser in C. Still, as it is, libxml2 is gonna be there if you have rox anyway -and who would do without that?

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#8 Post by goingnuts »

technosaurus: Thanks! The point to glade did the trick!
So in automation.c do

Code: Select all

-pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask,
-                                      &style->bg[GTK_STATE_NORMAL],
-                                       xpm_filename);
+colormap = gtk_widget_get_colormap (parent);
+pixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, +&mask, NULL, xpm_filename);
+ g_free (xpm_filename);
and warnings gone!

To make the "Closewindow" action work do this in automation.c

Code: Select all

-if (strncasecmp(str, "Closewindow:", 12) == 0) {
-		action_closewindow(button, &((char *) str)[12]);
-		return;
-	}

+if( strncasecmp(str, "Closewindow:", 11)==0 ){
+gdk_window_destroy( gtk_widget_get_parent_window(button) ); 
+return;
+}
which also seems to make function "action_closewindow" in actions.c unused and removable.

amigo: I do not hope this messing with gtk1 and the old gtkdialog source is "stepping on someones toes"? Should I ask someone for permission to do this or anything else to avoid violation of someone rights?

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post by technosaurus »

goingnuts wrote:I do not hope this messing with gtk1 and the old gtkdialog source is "stepping on someones toes"? Should I ask someone for permission to do this or anything else to avoid violation of someone rights?
It's GPL2, so aside from omitting COPYING from your tarball, you are good

before you remove the close window chunks, there are a couple of examples that open child windows (see original 0.58.11 sources gtk_launch)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#10 Post by goingnuts »

It's GPL2, so aside from omitting COPYING from your tarball, you are good
OK thanks - I will include that.
before you remove the close window chunks, there are a couple of examples that open child windows (see original 0.58.11 sources gtk_launch)
The patch was to make that example work - took the code-bit for "Closewindow" from 0.56 but haven't tried to remove the function from action.c yet - it just looks as nobody else is using it...

The idea of using parser method from jwm or other sources sounds good. Might remove need for the parser/lexer "black-box-stuff". I will try to catch up with all the patches until now, create a config.h for the DEFINES and try to create a single headerfile as you suggested - and submit a new source-tar.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#11 Post by technosaurus »

a good way (not perfect) to test if something is being used:
CFLAGS="-ffunction-sections -fdata-sections ..."
LDFLAGS="-Wl,--gc-sections,--print-gc-sections ..."

print-gc-sections will tell you which functions/data get garbage collected

Then again you _can_ just remove stuff to see what (if anything) breaks ... That's what I did with planner and gconf.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#12 Post by goingnuts »

Did not went well with the single header file - think the parser messed up. Also found that your gtkff failed if the "g_free (xpm_filename); " is in the GtkWidget *xpm_label_box function -as the only one of the scripts -so remove that from the function.
Would like to test the action append but cant find any examples on the format - anyone has an example of this?
We might have to make a more general test script to verify things are working as intended...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

I only posted gtkff because I had to head out for the weekend and wanted to have an extra example (I was backporting my Woo-ff stuff)

for testing I wonder if having an action:close ?syntax? at the end of a script with only 1 widget (or widget group) per script and testing for the return value would be workable?

Then have a single script with all of the widgets so that you can bypass running the test suite if it opens/closes properly. (btw I did get most of the 0.58.11 examples to run before I left, and it looked as if a lot of the gtkdialog2 apps may work with minimal modification, but I didn't have time to track them down)

the only other mods I made were to add various templates for implicit definition stuff to appropriate headers
the only ones I recall
added yy* stuff to parser.h and added parser.h to those *.c files that gcc complained about
basically a lot of:
grep <missing_template> *.c
then copy the:
<some_type> some_function(various args);
to the .h file of the same name as that .c file

I was just dumping it at the bottom so they may not make for good patches, because I couldn't readily determine the organizational structure of the code. I think I got it down to maybe 5 or so warnings.

Edit: so here is my todo list of apps in no particular order
backport some low hanging fruit (p-apps ... suggestions?)
union/aufs/symlink frontend for {s,2,3,4}fs.../iso/partitions/directories/...pretty much anything you can mount
archive utility (guitar and friends need to much tweaking)
simple mp3 player using minimp3 and signals

btw I am going to rewrite/rename bashbox from scratch for this and plan to incorporate CLI functionality where possible as well as optional text to speech (I'd like to have some kind of voice recognition too, so I'll probably stub that out)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#14 Post by goingnuts »

Updated source and shipped a static build version. Included examples from different versions - not all working or revised to work.
Now menu-widget is working including more than 1 command-action. Append works (syntax: <action>append:FROM,TOO</action>).
Tree is not working - tempted to just remove it.
Would like to implement alignment of text (its always centered in text-widget), user setting of button-size and have the edit-widget working as an small editor (file open/save and append works) but cant use "fileselection" to parse and open a file inside the edit-widget.
Still a "lot" of compiler warnings to fix...
Attachments
snap0001.png
The menu, entry and edit-widget in action
(15.74 KiB) Downloaded 2163 times

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#15 Post by amigo »

Keep up the good work. At some point I might work on patching the full sources so that config-time option for gtk1 can be used.

Text and tree code is the hardest to convert. For tips and example code, look at older source which allowed using either gtk1 or gtk1. rox-1.2.2 is one example. I'll have to dig to make more suggestions. even if you never get every possible widget working, having a few of the basics working will be great in order to use the same scripts with either toolkit.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

Note: some of these may be off by a line or 2 because I added #include "config.h" to all of the .c files, so I didn't need all of the -D... stuff to compile

Edit -- approximate eqivalent to locate (for the purposes of gtkdlg)

Code: Select all

#!/bin/sh
find /usr $HOME /opt -iname ${1##*/}
I did a bit of comparison shopping using thunor's patches from here:
http://code.google.com/p/gtkdialog/sour ... &start=320

In no particular order, except that I took note of them...

to help with using shells other than bash, he replaced

Code: Select all

source %s
with

Code: Select all

. %s
http://code.google.com/p/gtkdialog/source/detail?r=4#
I grepped them to be at
~246 of actions.c
~330 of widgets.c

this commit fixes the slow reading of vars (using -p / --program) compared to stdin (-s)
http://code.google.com/p/gtkdialog/source/detail?r=308#
I think this corresponds to ~152 of main.c
Fixed the longstanding issue with expand and fill being FALSE when packing
widgets into boxes. A message said that the original author couldn't get it to
work, but I can't see anything wrong with it.
many of these are ifdef gtk2, but Thunor's patch seems gtk1 doable:
http://code.google.com/p/gtkdialog/source/detail?r=296#

btw more gtk1/2 apps to scrape:
minimum profit 3
gftp <2.19
mtpaint
wireshark?
jpilot?
freeciv?
classicladder?
kmd (komodo manchester debugger)
http://www.web100.org/download/
http://mahjong.julianbradfield.org/Source/
http://ftp.eenet.ee/gentoo-portage/medi ... -gtk.patch
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#17 Post by goingnuts »

amigo wrote:Keep up the good work. At some point I might work on patching the full sources so that config-time option for gtk1 can be used.

Text and tree code is the hardest to convert. For tips and example code, look at older source which allowed using either gtk1 or gtk1. rox-1.2.2 is one example. I'll have to dig to make more suggestions. even if you never get every possible widget working, having a few of the basics working will be great in order to use the same scripts with either toolkit.
Thank you amigo - your offer is much appreciated - and your input on the tree/text widgets have convinced me that at least the tree should be left out. Concerning using the gtk-pixbuffer: I have no clue how to do it. For me the main thing missing right now is to be able to use more image-types - not just xpm - so if that can be done easily (with or without) gtk-pixbuffer...?

Technosaurous: Thanks for the pointers - I will add those!

There are other low hanging fruits: word-wrap to the edit-widget + default value and the geometry switch also seems easy done.

I have not been making a lot of shell gtk scripts until now - and begin to understand your blended feelings about the "xml-syntax". Maybe a more stringent structure is needed. Haven't thought this totally through but it seems that some of the tags means different things depending on which widget they are serving. I have done a lot of html and do not find that hard to write/read and maybe a clean up of the tags are needed? Maybe only "clean" tags (<button> and no <button ok>, <input> and no <input file>)? Some of the tags express both what I would call state and value (ex: <default>)...

At least a mapping of the present hierarchy of widgets, childs, childs child, attributes and actions should be done.

As for other programs to "scrape" the Xdialog-2.3.1 is quite relevant.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#18 Post by technosaurus »

would it be easier to develop something from scratch?
I used code from glade to help implement this:

Code: Select all

#include <stdio.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

/* TODO use these for switch case(s) in main loop */
#define FIVE_CHARS(x1,x2,x3,x4,x5)   (((((((((x5)<<8)|(x4))<<8)|(x3))<<8)|(x2))<<8)|(x1))

void on_button_clicked(GtkButton *button, char *user_data){printf("action=\"%s\"\n",user_data);}
void on_checkbutton_toggled(GtkToggleButton *togglebutton, char *user_data){
	if (GTK_TOGGLE_BUTTON(togglebutton)->active){
		printf("%s=\"on\"\n",user_data);
	}else{
		printf("%s=\"off\"\n",user_data);
	}
}

int main(int argc, char *argv[]){
GtkWidget *widgets[99],packers[9];
char *button_action[0];
int widget=1, packer=0 ,i=1;

gtk_set_locale ();
gtk_init (&argc, &argv);

/* TODO shift this into main loop and add title support */
widgets[0] = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_object_set_data (GTK_OBJECT (widgets[0]), "window", widgets[0]);
gtk_window_set_title (GTK_WINDOW (widgets[0]), "title");

/* TODO shift this into main loop and add hbox support - need packer stack */

/* TODO shift stuff into this loop and add widgets */
while (i<argc){ /* loop through args to make widgets - buttons with actions */
switch ( FIVE_CHARS(argv[i][0],argv[i][1],argv[i][2],argv[i][3],argv[i][4]) ) {
case FIVE_CHARS('-','v','b','o','x')   :
	widgets[widget] = gtk_vbox_new (FALSE, 0);
	gtk_widget_ref (widgets[widget]);
	gtk_object_set_data_full(GTK_OBJECT(widgets[0]), "box", widgets[widget],
		(GtkDestroyNotify) gtk_widget_unref);
	gtk_widget_show (widgets[widget]);
	gtk_container_add(GTK_CONTAINER (widgets[0]), widgets[widget]);
	i++;widget++;
break;

case FIVE_CHARS('-','h','b','o','x')   :
	widgets[widget] = gtk_hbox_new (FALSE, 0);
	gtk_widget_ref (widgets[widget]);
	gtk_object_set_data_full(GTK_OBJECT(widgets[0]), "box", widgets[widget],
		(GtkDestroyNotify) gtk_widget_unref);
	gtk_widget_show (widgets[widget]);
	gtk_container_add(GTK_CONTAINER (widgets[0]), widgets[widget]);
	i++;widget++;
break;

case FIVE_CHARS('-','b','u','t','t')   :
	i++;
/* TODO make this a switch case here for widgets */
	widgets[widget] = gtk_button_new_with_label(argv[i]);
	gtk_widget_ref (widgets[widget]);
/* TODO? is widget 0 always correct? */
	gtk_object_set_data_full(GTK_OBJECT (widgets[0]), argv[i], widgets[widget],(GtkDestroyNotify) gtk_widget_unref);
	gtk_widget_show(widgets[widget]);
/* TODO replace hardcoded packer with a "stack" */
	gtk_box_pack_start(GTK_BOX (widgets[1]), widgets[widget], FALSE, FALSE, 0);
/* TODO replace button_action with generic char array */
	i++;
	button_action[widget] = argv[i];
	if (button_action[widget] != NULL){
		gtk_signal_connect(GTK_OBJECT (widgets[widget]), "clicked", 
			GTK_SIGNAL_FUNC(on_button_clicked),button_action[widget]);
		i++;
		}
	widget++;
break;

case FIVE_CHARS('-','c','h','e','c')   :
	i++;
	widgets[widget] = gtk_check_button_new_with_label (argv[i]);
	gtk_widget_ref (widgets[widget]);
	gtk_object_set_data_full (GTK_OBJECT (widgets[0]), argv[i], widgets[widget],
		(GtkDestroyNotify) gtk_widget_unref);
	gtk_widget_show (widgets[widget]);
	gtk_box_pack_start (GTK_BOX (widgets[1]), widgets[widget], FALSE, FALSE, 0);
	i++;
	gtk_signal_connect (GTK_OBJECT (widgets[widget]), "toggled",
		GTK_SIGNAL_FUNC (on_checkbutton_toggled), argv[i]);
	i++;widget++;
break;

default   :
	printf("usage:\n%s -{v,h}box [-button label action] [-checkbox label variable]\n",argv[0]);
	goto END;
	break;
}
}

gtk_signal_connect(GTK_OBJECT (widgets[0]), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit),NULL);
gtk_widget_show(widgets[0]);
gtk_main();
END:
return 0;
}
Last edited by technosaurus on Thu 09 Feb 2012, 02:10, edited 4 times in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#19 Post by amigo »

For an example of stacking widgets, see greq:
http://distro.ibiblio.org/pub/linux/dis ... req-0.9.4/

It uses a little known feature of bash -PIPE_STATUS to return the results. It also lets you add a checkbutton after any normal widget.

As for re-inventing the wheel, it might be best to just hack one of the existing programs, but that's just me thinking. I'd really like to see a gtk1 version of gtkdialog which implements as many of the features of the gtk2 version as possible, using the same syntax. The dual-toolkit compatibility is the magic of it.

I think most of problem you are having with the includes must come from not having configuration done properly at the top-level of the sources. Most gtk1/gtk2 capable programs manage to live in the same files without having to do major re-writes -just some -maybe lots, of ifdefs.

I wish I could be more helpful but my hands are tied right now with other things.

I have built lots of small 'programs' using scriptable widgets made from Xdialog, greq, gtk-shell and the other things found here:
http://distro.ibiblio.org/pub/linux/dis ... req-0.9.4/

I like the ability to create more complex UI's that is possible with gtkdialog, but do not like the startup latency of any gtk2 apps. The libxml overhead is probably livable...

gdk-pixbuf should load any of the common types of images/icons -png-support would be the best choice if only one is to be supported. rox has good example of gdk-pixbuf support -if you look through my rox-1.2.2.x sources you'll find a patch where I made it use png toolbar icons instead of xpm's. I still think it might be a good idea to run the whole idea by thunor as he may be able to get some things going which are harder for you -maybe the whole enchilada...

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#20 Post by goingnuts »

technosaurus & amigo: Thanks for input! Might be difficult to make it gtk2 compatible as this include hacking the parser as far as I can see (to accept the newer script syntax). To start from scratch is tempting when one view the simple structure of the possible coding...but may be too big a project for now...
Spend some time in hacking the edit and fileselect to play well with a menu-driven small text-editor but hit a problem with interference with the event-triggers trying to implement a "save as..." function...
I miss the ability to assign values to internal variables from script, run an external function (script) to change/add values...or just an invisible widget or two that act as the normal widgets...

Post Reply