FACT++  1.0
Widget create_button ( char *  name,
SERVER servp 
)

Definition at line 2611 of file didMarkus.c.

References activate_clients(), activate_services(), Curr_matrix, did_default_font, did_server_font, Matrix_id, MAX_NAME, MAX_TASK_NAME, DNS_SERVER_INFO::n_services, item::server, and set_something().

Referenced by update_show_servers().

2612 {
2613 Arg arglist[10];
2614 int n, n_services = -1;
2615 Widget w, ww, w_id;
2617 char w_name[MAX_NAME];
2618 
2619  w_name[0] = 0;
2620  if(servp)
2621  n_services = servp->server.n_services;
2622  strcpy(w_name,name);
2623  if(strlen(w_name) >= MAX_TASK_NAME - 4)
2624  w_name[16] = '\0';
2625  n = 0;
2626  XtSetArg(arglist[n], XmNorientation, XmVERTICAL); n++;
2627  XtSetArg(arglist[n], XmNentryAlignment, XmALIGNMENT_CENTER); n++;
2628  w_id = w = XmCreateMenuBar(Matrix_id[Curr_matrix],
2629  (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
2630  arglist,n);
2631 /*
2632  if(n_services == -1)
2633  set_color(w, XmNbackground, RED);
2634  else
2635  set_color(w, XmNbackground, GREEN);
2636 */
2637  XtManageChild(w);
2638  strcat(w_name,"1");
2639  n = 0;
2640  XtSetArg(arglist[n], XmNalignment, XmALIGNMENT_CENTER); n++;
2641  XtSetArg(arglist[n], XmNfontList, did_server_font); n++;
2642  w = XmCreateCascadeButton(w,
2643  (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
2644  arglist,n);
2645  set_something(w,XmNlabelString,name);
2646  set_something(w,XmNalignment,XmALIGNMENT_CENTER);
2647 /*
2648  if(n_services == -1)
2649  set_color(w, XmNbackground, RED);
2650  else
2651  set_color(w, XmNbackground, GREEN);
2652 */
2653  set_something(w_id,XmNuserData,w);
2654  strcat(w_name,"1");
2655  n = 0;
2656  ww = XmCreatePulldownMenu(w_id,
2657  (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
2658  arglist,n);
2659  set_something(w,XmNsubMenuId,ww);
2660  XtManageChild(w);
2661  strcat(w_name,"1");
2662  n = 0;
2663  XtSetArg(arglist[n], XmNfontList, did_default_font); n++;
2664  w = XmCreatePushButton(ww,
2665  (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
2666  arglist,n);
2667 
2668  set_something(w,XmNlabelString,"Services");
2669  if(servp)
2670  {
2671  XtAddCallback(w,XmNactivateCallback, activate_services, servp);
2672  XtManageChild(w);
2673  strcat(w_name,"1");
2674  n = 0;
2675  XtSetArg(arglist[n], XmNfontList, did_default_font); n++;
2676  w = XmCreatePushButton(ww,
2677  (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET),
2678  arglist,n);
2679 
2680  set_something(w,XmNlabelString,"Clients");
2681  XtAddCallback(w,XmNactivateCallback, activate_clients, servp);
2682  XtManageChild(w);
2683  /*
2684  servp->popping = 0;
2685  create_client_popup(servp);
2686  */
2687  }
2688  return(w_id);
2689 }
static XmFontList did_server_font
Definition: didMarkus.c:40
#define MAX_NAME
Definition: dim.h:182
void activate_clients(Widget w, SERVER *servp, unsigned long *reason)
Definition: didMarkus.c:2965
Widget Matrix_id[2]
Definition: did.h:57
void activate_services(Widget w, SERVER *servp, unsigned long *reason)
Definition: didMarkus.c:2718
static XmFontList did_default_font
Definition: didMarkus.c:40
#define MAX_TASK_NAME
Definition: dim.h:181
void set_something()
DNS_SERVER_INFO server
Definition: did.h:44
int Curr_matrix
Definition: did.h:58
int n_services
Definition: dim.h:341

+ Here is the call graph for this function:

+ Here is the caller graph for this function: