Am Dienstag 30 Oktober 2007 19:25:06 schrieb Christian Riggenbach:
> Am Dienstag 30 Oktober 2007 14:15:26 schrieb DJ Delorie:
> > > i add it to action.c, but i can't implement it in lesstif.
> >
> > Just edit pcb-menu.res
> >
> > You don't need to edit anything in hid/lesstif at all.
> >
> >
> > _______________________________________________
> > geda-dev mailing list
> > [email protected]
> > http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
>
> the probles is, that this action needs a netlist to work with. i don't know
> how to get a netlist from the main-menu.
>
> as i write in the first mail, this stuff is added to the netlist window,
> which is located in hid/gtk/.
>
>
> my kind regards
>
> Christian Riggenbach
>
>
> _______________________________________________
> geda-dev mailing list
> [email protected]
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

here is my new patch.

it add support for the scripting hid.

i use hid_actionl to invoke the function from the gtk-hid.


my kind regards

Christian Riggenbach
Index: src/action.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/action.c,v
retrieving revision 1.115
diff -b -r1.115 action.c
1983a1984,2010
> static const char setthermalstonet_syntax[] =
>   "SetThermalToNet(Net)";
> 
> static const char setthermalstonet_help[] =
>   "Add a thermal to all pins of a net.\n"
>   "The style is taken from the default of the pcb.\n";
> 
> /* The same as above, but add thermals to a whole net */
> 
> static int
> ActionSetThermalsToNet (int argc, char **argv, int x, int y)
> {
> 
>   char i[1];
>   char buffer[5], j;
> 
>   if (argc < 1)
>     AFAIL (message);
> 
>   sprintf(i, "%lu", PCB->ThermStyle);
> 
>   hid_actionl ("connection", "reset", NULL);
>   hid_actionl ("netlist", "select", argv[0], NULL);
>   hid_actionl ("SetThermal", "SelectedPins", i, NULL);
>   hid_actionl ("connection", "reset", NULL);
> 
> }
6746a6774,6776
>   {"SetThermalsToNet", 0, ActionSetThermalsToNet,
>    setthermalstonet_help, setthermalstonet_syntax}
>   ,
Index: src/hid/gtk/gui-netlist-window.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gui-netlist-window.c,v
retrieving revision 1.13
diff -b -r1.13 gui-netlist-window.c
485a486,501
> /* A function to add a thermal to all pins of a net */
> static void
> netlist_add_thrm_cb (GtkWidget * widget, gpointer data)
> {
> 
>   char *name = NULL;
> 
>   if (!selected_net)
>     return;
> 
>   name = selected_net->Name + 2;
> 
>   hid_actionl ("SetThermalsToNet", name, NULL);
> 
> }
> 
681a698,702
>   button = gtk_button_new_with_label (_("Add thermals"));
>   gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
>   g_signal_connect (G_OBJECT (button), "clicked",
> 		    G_CALLBACK (netlist_add_thrm_cb), GINT_TO_POINTER (0));
> 

Attachment: signature.asc
Description: This is a digitally signed message part.


_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to