Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 Jul 2014, 09:34
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
C programming with gtk using glade and glade-2
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [44 Posts]   Goto page: 1, 2, 3 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Tue 03 Jan 2012, 01:31    Post subject:  C programming with gtk using glade and glade-2  

Foreword:
I like to compile small statically compiled apps written in C, but the new versions of glade have removed the ability to output the C code. For a while this was bad because you had to include libglade, but then there was gtkbuilder (since gtk-2.12). The problem is that when you highly optimize your compiles, the code that is reference in the gtkbuilder UI file can get removed. There are plenty of other reasons for wanting all the code compiled in, but I don't need any more than that, so I have started learning how to use the older versions of glade (0.6.4 for gtk1 and 2.12.2 for gtk2) and thought I would share it here.

The 2 biggest things you need to know are:

1. You need to add a signal handler to the window to "destroy" signals with gtk_main_quit

2. If you want to insert code for a button press, etc... you need to add a signal for that event ... ex. button1 clicked - by default will give you an empty callback function in callbacks.c for on_button1_clicked (add your code there)

tutorial to follow (it is taking 10x longer to write the tutorial than it did to figure it out)
glade-0.6-i586.pet
Description 
pet

 Download 
Filename  glade-0.6-i586.pet 
Filesize  209.02 KB 
Downloaded  360 Time(s) 
glade-2.12.2-i586.pet
Description 
pet

 Download 
Filename  glade-2.12.2-i586.pet 
Filesize  241.53 KB 
Downloaded  437 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101

Last edited by technosaurus on Fri 10 Feb 2012, 15:03; edited 2 times in total
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 03 Jan 2012, 15:52    Post subject:  

technosaurus just want to thank you for this.
I may not use it for some time but glade is something I had difficulty with using.
Be interested in how others get on with the tutorial? Smile

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Tue 03 Jan 2012, 17:09    Post subject:  

i just patched the glade1 source (glade/source.c) with this:

Code:
      fprintf (fp,
+          "  add_pixmap_directory (\"/usr/share/pixmaps\");\n"
+          "  add_pixmap_directory (\"/usr/share/mini-icons\");\n"
          "  add_pixmap_directory (PACKAGE_DATA_DIR \"/pixmaps\");\n"
          "  add_pixmap_directory (PACKAGE_SOURCE_DIR \"/%s\");\n",
          relative_pixmaps_directory);
      g_free (relative_pixmaps_directory);
    }


This would allow us to use the regular /usr/share/pixmaps and /usr/share/mini-icons directories for the pixmaps, so that they can be shared with other apps - I haven't posted the pet yet, because I am not sure if they should be first or last in the search order??? (I was initially going to remove the others all together)... I seem to recall wrong icons causing a problem before (but that was gtk2)

I also patched the sources of glade2 so it would compile, but then I decided to remove all gtk/gtk*.h references (the offenders) and replace them with a single <gtk/gtk.h> in config.h

I'm not trying to "fork" them but sometimes you have to sharpen even borrowed tools.
glade-2.12.2-fix_includes_pixmap_paths.gz
Description 
gz

 Download 
Filename  glade-2.12.2-fix_includes_pixmap_paths.gz 
Filesize  5.79 KB 
Downloaded  327 Time(s) 
glade1-add_pixmap_path-rename_desktop.patch.gz
Description 
gz

 Download 
Filename  glade1-add_pixmap_path-rename_desktop.patch.gz 
Filesize  19.58 KB 
Downloaded  288 Time(s) 

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Wed 08 Feb 2012, 12:39    Post subject:  

here is a simple buttons app I wrote from what I learned playing with glade-0.6.x
gcc -Os -o gtkbuttons `gtk-config --cflags` main.c -lgtk -s
usage: ./gtkbuttons list of buttons
Code:
#include <stdio.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

void on_button_clicked(GtkButton *button, char *user_data){printf("%s\n",user_data);}

int main(int argc, char *argv[]){
GtkWidget *window1, *vbox1, *button[0];
char *button_action[0];
int i=0;

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

window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_object_set_data (GTK_OBJECT (window1), "window1", window1);
gtk_window_set_title (GTK_WINDOW (window1), "window1");

vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_ref (vbox1);
gtk_object_set_data_full (GTK_OBJECT (window1), "vbox1", vbox1,(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (window1), vbox1);

while (i<argc-1){ /* loop through args to make buttons with actions */
   button[i] = gtk_button_new_with_label(argv[i+1]);
   gtk_widget_ref (button[i]);
   gtk_object_set_data_full (GTK_OBJECT (window1), argv[i+1], button[i],(GtkDestroyNotify) gtk_widget_unref);
   gtk_widget_show (button[i]);
   gtk_box_pack_start (GTK_BOX (vbox1), button[i], FALSE, FALSE, 0);
   button_action[i] = argv[i+1];
   gtk_signal_connect (GTK_OBJECT (button[i]), "clicked",GTK_SIGNAL_FUNC (on_button_clicked),button_action[i]);
   i++;
}

gtk_signal_connect (GTK_OBJECT (window1), "destroy",GTK_SIGNAL_FUNC (gtk_main_quit),NULL);
gtk_widget_show (window1);
gtk_main ();
return 0;
}

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Thu 09 Feb 2012, 22:07    Post subject:  

My little example has turned into this, just basically cutting and pasting from glade:
Code:
#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))
#define WINDOW FIVE_CHARS('-','w','i','n','d')
#define VBOX FIVE_CHARS('-','v','b','o','x')
#define HBOX FIVE_CHARS('-','h','b','o','x')
#define HSEPARATOR FIVE_CHARS('-','h','s','e','p')
#define VSEPARATOR FIVE_CHARS('-','v','s','e','p')
#define LABEL FIVE_CHARS('-','l','a','b','e')
#define BUTTON FIVE_CHARS('-','b','u','t','t')
#define CHECKBOX FIVE_CHARS('-','c','h','e','c')
#define TEXT FIVE_CHARS('-','t','e','x','t')
#define HSCALE FIVE_CHARS('-','h','s','c','a')
#define VSCALE FIVE_CHARS('-','v','s','c','a')

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=0, packer=0 ,i=1,j;

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

while (i<argc){ /* loop through args to make widgets - buttons with actions */
j=FIVE_CHARS(argv[i][0],argv[i][1],argv[i][2],argv[i][3],argv[i][4]);
switch ( j ) {

case   WINDOW   :   
   i++;
   widgets[widget] = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_object_set_data(GTK_OBJECT(widgets[widget]), "window", widgets[widget]);
   gtk_window_set_title(GTK_WINDOW(widgets[widget]), argv[i]);
   gtk_widget_show(widgets[0]);
break;

case   VBOX   :
   widgets[widget] = gtk_vbox_new (FALSE, 0);
break;

case   HBOX   :
   widgets[widget] = gtk_hbox_new (FALSE, 0);
break;

case   HSEPARATOR   :
   widgets[widget] = gtk_hseparator_new ();
break;

case   VSEPARATOR   :
   widgets[widget] = gtk_vseparator_new ();
break;
   
case   LABEL   :   
   i++;
   widgets[widget] = gtk_label_new (argv[i]);
break;

case   BUTTON   :
   i++;
   widgets[widget] = gtk_button_new_with_label(argv[i]);
   i++;
   gtk_signal_connect(GTK_OBJECT (widgets[widget]), "clicked", GTK_SIGNAL_FUNC(on_button_clicked),argv[i]);
break;

case   CHECKBOX   :
   i++;
   widgets[widget] = gtk_check_button_new_with_label (argv[i]);
   i++;
   gtk_signal_connect (GTK_OBJECT (widgets[widget]), "toggled", GTK_SIGNAL_FUNC (on_checkbutton_toggled), argv[i]);
break;

case   TEXT   :
   widgets[widget] = gtk_text_new (NULL, NULL);
   i++;
   gtk_text_insert (GTK_TEXT (widgets[widget]), NULL, NULL, NULL, argv[i], -1);
   //gtk_signal_connect (GTK_OBJECT (widgets[widget]), "changed", GTK_SIGNAL_FUNC (on_text_changed), NULL);
break;

case   HSCALE   :
   widgets[widget] = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 0, 0)));
   //gtk_signal_connect (GTK_OBJECT (widgets[widget]), "drag_end", GTK_SIGNAL_FUNC (on_scale_drag_end), NULL);
break;

case   VSCALE   :
   widgets[widget] = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 0, 0)));
   //gtk_signal_connect (GTK_OBJECT (widgets[widget]), "drag_end", GTK_SIGNAL_FUNC (on_scale_drag_end), NULL);
break;

default   :
   printf(   "usage:\n%s -window title -{v,h}box [-button label action] [-checkbox label var]\n"
         "   Last argument processed was %s \n",argv[0],argv[i]);
   goto END;
break;
}

switch ( j ) {

case   WINDOW   :   break;
case   VBOX   :
case   HBOX   :
   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_container_add(GTK_CONTAINER (widgets[0]), widgets[widget]);
break;

default   :
   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], TRUE, TRUE, 0);
break;
}
i++;widget++;
}

gtk_signal_connect(GTK_OBJECT (widgets[0]), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit),NULL);
gtk_main();
END:
return 0;
}
The process is pretty simple. add a widget that you like from glade write the code and paste into one of the templates.
Now if I could only get the packers (windows, v/hboxes, frames, notebooks...) figured out, it could be a fast alternative to other *dialog programs

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Fri 10 Feb 2012, 14:51    Post subject:  

here are a couple of tricks for making smaller code:

#define DTOS(x) #x
// allows you to write number types as strings using puts or write
//the stdio functions like *printf add ~10kb of overhead in static builds
//this is especially important for daemon processes that need to be fast ...
//... it helps them stay in cache

in my previous example I used a switch-case on a 5 character string
normally this is not possible since the case values need to evaluate to a constant int
to get around this requirement we perform bit operation on the string
this is done inside a macro (#define ...) in order to simplify type
... and so that the c preprocessor can evaluate the value prior to run time
the only code added then is a static constant
if you need to do this many times, you can decrease the compiled size with
-fmerge-all-constants
(this may make break some code... usually C++, so it is not enabled by default)
anyhow, with all that said even if you don't use extra compiler flags,
the switch case is much smaller and faster than a series of string comparisons

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 777

PostPosted: Fri 10 Feb 2012, 16:35    Post subject:  

This is really cool! Compiled your gtk-thing to 7K so although rudimentary at the moment it could have potential for a new small gtkdialog with a more clean approach to parsing scripts...Do you plan to take it further?
The define and macro technique might be optimal - but not easy to read... Smile
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Fri 10 Feb 2012, 23:01    Post subject:  

if it is hard to read I am open to suggestion, but I always use tabs vs spaces and don't habitually wrap at 80 chars unless it reads better that way (my font screen combo is limited to 150, but there is always a convenient break well before that)... but yes I do want to take it further. The all caps thing is common practice for macros, but not absolutely necessary if its bothersome (sidebar: some people even replace entire sets of typedefs with macros to cut overhead in embedded systems to save having to do silly stuff like converting gint to int to tell gcc to shut the Hell up, but then the programmer isn't protected from himself and things may go boom ... or so they say - basically glib is reimplementing some functionality and protections of the C++ stl with its typedefs)

before I take it too much further, I need to solve the packing problem. I have it solved in my head, but getting it coded will test my fledgling coding ability to its max. basically I need to track packers in a stack so they can be "popped" when a -close tag is hit, but some widgets can only have one thing packed inside (window, frame, notebook...) so just pack 1 widget in those with a container_add and POP it, while others can have multiple widgets (hbox, vbox, and even buttons) so keep packing widgets in there until a new packer tag is reached (which will get pushed) or a -close tag is reached then POP it.

I am going through the gtk1.2 tutorial to get an understanding of the shared properties between widgets, so that it can be generalized properly from the start ... its much easier to fix 100 lines of code than 1000.

The whole idea is to use the arg parameters to do all of the widget drawing and have everything else controlled by input/output streams (fifos and pipes from shell, tcl, perl, compiled programs, etc...) the Unix philosophy basically, do 1 thing and do it well. gtk has idle functions that can be used to process the stream... but I am not sure if I should use sockets or just open arson for monitoring i/o... put that on the todo list as well, whichever is the simplest that barely gets the job done wins... it just needs to be able to get data so it can go through a switch-case for the action, do an exact match on the widget by name or class and process an event or call a handler function to do it. I'm leaning towards stdin + stdout since nearly every language I know of can handle it.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Sat 11 Feb 2012, 03:11    Post subject:  

packing problem solved
Code:
//#include <sys/timeb.h> //time metrics

#include <stdio.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#define GTK_NO_CHECK_CASTS
#define G_DISABLE_CAST_CHECKS
#define NDEBUG

#define FIVE_CHARS(x1,x2,x3,x4,x5)   (((((((((x5)<<8)|(x4))<<8)|(x3))<<8)|(x2))<<8)|(x1))
#define WINDOW FIVE_CHARS('-','w','i','n','d')
#define FRAME FIVE_CHARS('-','f','r','a','m')
#define VBOX FIVE_CHARS('-','v','b','o','x')
#define HBOX FIVE_CHARS('-','h','b','o','x')
#define CLOSE FIVE_CHARS('-','c','l','o','s')
#define HSEPARATOR FIVE_CHARS('-','h','s','e','p')
#define VSEPARATOR FIVE_CHARS('-','v','s','e','p')
#define LABEL FIVE_CHARS('-','l','a','b','e')
#define BUTTON FIVE_CHARS('-','b','u','t','t')
#define CHECKBOX FIVE_CHARS('-','c','h','e','c')
#define TEXT FIVE_CHARS('-','t','e','x','t')
#define HSCALE FIVE_CHARS('-','h','s','c','a')
#define VSCALE FIVE_CHARS('-','v','s','c','a')

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];
unsigned char widget=0, i=1, containers=0, packer=0, packers[9];
int j;

//struct timeb tmb; ftime(&tmb); printf("%ld.%d\n", tmb.time, tmb.millitm);//time metrics

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

while (i<argc){ /* loop through args to make widgets - buttons with actions */
j=FIVE_CHARS(argv[i][0],argv[i][1],argv[i][2],argv[i][3],argv[i][4]);

switch ( j ) { /* initialize widgets based on -tag */
case   WINDOW   :   
   i++;
   widgets[widget] = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_object_set_data(GTK_OBJECT(widgets[widget]), argv[i], widgets[widget]);
   gtk_window_set_title(GTK_WINDOW(widgets[widget]), argv[i]);
break;

case   CLOSE   :   break;

case   VBOX   :
   widgets[widget] = gtk_vbox_new (FALSE, 0);
break;

case   HBOX   :
   widgets[widget] = gtk_hbox_new (FALSE, 0);
break;

case   HSEPARATOR   :
   widgets[widget] = gtk_hseparator_new ();
break;

case   VSEPARATOR   :
   widgets[widget] = gtk_vseparator_new ();
break;
   
case   LABEL   :   
   i++;
   widgets[widget] = gtk_label_new (argv[i]);
break;

case   BUTTON   :
   i++;
   widgets[widget] = gtk_button_new_with_label(argv[i]);
   i++;
   gtk_signal_connect(GTK_OBJECT (widgets[widget]), "clicked", GTK_SIGNAL_FUNC(on_button_clicked),argv[i]);
break;

case   CHECKBOX   :
   i++;
   widgets[widget] = gtk_check_button_new_with_label (argv[i]);
   i++;
   gtk_signal_connect (GTK_OBJECT (widgets[widget]), "toggled", GTK_SIGNAL_FUNC (on_checkbutton_toggled), argv[i]);
break;

case   TEXT   :
   widgets[widget] = gtk_text_new (NULL, NULL);
   i++;
   gtk_text_insert (GTK_TEXT (widgets[widget]), NULL, NULL, NULL, argv[i], -1);
   //gtk_signal_connect (GTK_OBJECT (widgets[widget]), "changed", GTK_SIGNAL_FUNC (on_text_changed), NULL);
break;

case   HSCALE   :
   widgets[widget] = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 0, 0)));
   //gtk_signal_connect (GTK_OBJECT (widgets[widget]), "drag_end", GTK_SIGNAL_FUNC (on_scale_drag_end), NULL);
break;

case   VSCALE   :
   widgets[widget] = gtk_vscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 0, 0)));
   //gtk_signal_connect (GTK_OBJECT (widgets[widget]), "drag_end", GTK_SIGNAL_FUNC (on_scale_drag_end), NULL);
break;

default   :
   printf(   "usage:\n%s -window title -{v,h}box [-button label action] [-checkbox label var]\n"
         "   Last argument processed was %s \n",argv[0],argv[i]);
   goto END;
break;
} /* end initializing widgets from -tag */

/* begin stuff that all widgets need to do */
gtk_widget_show (widgets[widget]);
gtk_widget_ref (widgets[widget]);
gtk_object_set_data_full (GTK_OBJECT (widgets[0]), argv[i], widgets[widget], (GtkDestroyNotify) gtk_widget_unref);
/* end stuff that all widgets need to do */

switch ( j ) { /* begin packing */
case   CLOSE   :
case   WINDOW   :   break;

default   :
   if (containers > 0){
      gtk_container_add(GTK_CONTAINER (widgets[0]), widgets[widget]);
      containers--;
   }else{
      gtk_box_pack_start(GTK_BOX(widgets[packers[packer]]), widgets[widget], TRUE, TRUE, 0);
   }
break;
} /* end packing */

switch   ( j )   { /* PUSH/POP packers */
case   CLOSE   :   packer--; break;
case   FRAME   :   
case   WINDOW   :   containers++;
case   VBOX   :   
case   HBOX   :   packer++;
               packers[packer] = widget;
               break;
} /* PUSH/POP packers */

i++;widget++;  /* for argv[] and widgets[] */
} /* end arg loop */

gtk_signal_connect(GTK_OBJECT (widgets[0]), "destroy", GTK_SIGNAL_FUNC (gtk_main_quit),NULL);

//ftime(&tmb); printf("%ld.%d\n", tmb.time, tmb.millitm);//time metrics --currently about 45 msec

gtk_main();
END:
return 0;
}

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6422
Location: Auckland, New Zealand

PostPosted: Sat 11 Feb 2012, 03:29    Post subject:  

Quote:
potential for a new small gtkdialog

And here I was thinking everybody wanted gtkdialog without a glade dependency...
I suppose it's a bit different if glade is only used for generating C code, and is not a runtime dependency.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 777

PostPosted: Sat 11 Feb 2012, 05:11    Post subject:  

Great with the packer working Very Happy. For the visual oriented attached 2 examples running the present sdialog:

./sdialog -window "Test Widgets" -vbox -button Help helpme -hbox -button OK ok -vbox -checkbox Check1 TEST1 -checkbox Check2 TEST2 -close -button "New Button" exit -text "Some text in text widget" -close -hseparator -label "And a horizontal slider..." -hseparator -hscale -close

and a simple yes/no-dialog:
./sdialog -window "Test of sdialog 110212" -vbox -vbox -label "Is This Cool?" -close -hbox -button Yes yep -button No nono -close -close
snap0003.png
 Description   
 Filesize   8.71 KB
 Viewed   1254 Time(s)

snap0003.png

snap0002.png
 Description   
 Filesize   5.07 KB
 Viewed   1260 Time(s)

snap0002.png

Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Sat 11 Feb 2012, 05:24    Post subject:  

oops the -close tag didn't work -fixed
moved the window show to the end to prevent a flicker that the human eye could barely see (due to window drawing and later resizing)
sdialog-test.tar.gz
Description  here it is with a prebuilt binary, build script and sources
gz

 Download 
Filename  sdialog-test.tar.gz 
Filesize  5.24 KB 
Downloaded  274 Time(s) 
sdialog.png
 Description   
 Filesize   4.35 KB
 Viewed   1256 Time(s)

sdialog.png


_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4275

PostPosted: Sat 11 Feb 2012, 13:33    Post subject:  

disciple wrote:
Quote:
potential for a new small gtkdialog

And here I was thinking everybody wanted gtkdialog without a glade dependency...
I suppose it's a bit different if glade is only used for generating C code, and is not a runtime dependency.
that would be _libglade because with gtk2.12, they introduced gtkbuilder which does essentially the same thing... glade otoh continues to be an excellent development tool, but for whatever reason, instead of dropping support for libglade xml files when it was deprecated, they dropped support for c output instead ... I guess they figured that everyone preferred xml to having to compile... they do work pretty well and now that I understand the callback functions, it may be more useful.[/b]
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6422
Location: Auckland, New Zealand

PostPosted: Sat 11 Feb 2012, 20:50    Post subject:  

There's a lot of discussion on old mailing lists about why glade doesn't generate code anymore. It mostly seems to come down to an accepted wisdom that generated code is "bad" and that it would make both glade and the applications produced more complicated and difficult to maintain.
Also, Glade-3 is supposed to be:
Wikipedia wrote:
a complete rewrite, in order to take advantage of the new features of GTK+ 2 and the GObject system (Glade-3 was started when Glade-1 hadn't yet been ported to GTK+ 2)

I don't know how much a "complete rewrite" is the same as "starting from scratch", but maybe it was less a case of removing support for code generation, and more a case of not spending the time to reimplement it.

Quote:
I guess they figured that everyone preferred xml to having to compile

I'm not sure there's much of an advantage here - libglade or gtkbuilder files are both typically used by compiled programs anyway...

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6422
Location: Auckland, New Zealand

PostPosted: Sat 11 Feb 2012, 20:54    Post subject:  

BTW, thanks for the packages. I always wanted to have a play around with glade-2, but I think at one stage it was hard to find for some reason.

I'm curious as to why more people are downloading the GTK1 version...

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [44 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1493s ][ Queries: 13 (0.0124s) ][ GZIP on ]