本文整理汇总了C++中OBJ_GET函数的典型用法代码示例。如果您正苦于以下问题:C++ OBJ_GET函数的具体用法?C++ OBJ_GET怎么用?C++ OBJ_GET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OBJ_GET函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ms1_tlogger_button_handler
EXPORT gboolean ms1_tlogger_button_handler(GtkWidget * widget, gpointer data)
{
gint handler = (GINT)OBJ_GET(widget, "handler");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{ /* It's pressed (or checked) */
switch ((ToggleButton)handler)
{
case START_TOOTHMON_LOGGER:
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget("triggerlogger_buttons_table")),FALSE);
bind_ttm_to_page((GINT)OBJ_GET(widget,"page"));
start_tickler(TOOTHMON_TICKLER);
break;
case START_TRIGMON_LOGGER:
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget("toothlogger_buttons_table")),FALSE);
bind_ttm_to_page((GINT)OBJ_GET(widget,"page"));
start_tickler(TRIGMON_TICKLER);
break;
case STOP_TOOTHMON_LOGGER:
stop_tickler(TOOTHMON_TICKLER);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget("triggerlogger_buttons_table")),TRUE);
break;
case STOP_TRIGMON_LOGGER:
stop_tickler(TRIGMON_TICKLER);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget("toothlogger_buttons_table")),TRUE);
break;
default:
break;
}
}
return TRUE;
}
开发者ID:Torture,项目名称:MegaTunix,代码行数:33,代码来源:ms1-t-logger.c
示例2: ecu_toggle_button_handler
/*!
\brief ECU specific toggle button handler
\param widget is a pointer to the widget the user modified
\param data is unused
\returns TRUE
*/
G_MODULE_EXPORT gboolean ecu_toggle_button_handler(GtkWidget *widget, gpointer data)
{
extern MS2_TTMon_Data *ttm_data;
gint handler = -1;
ENTER();
handler = (GINT)OBJ_GET(widget,"handler");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{ /* It's pressed (or checked) */
switch ((MS2ToggleHandler)handler)
{
case START_TOOTHMON_LOGGER:
ttm_data->stop = FALSE;
OBJ_SET(ttm_data->darea,"io_cmd_function",(gpointer)"ms2_e_read_toothmon");
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget_f("triggerlogger_buttons_table")),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget_f("compositelogger_buttons_table")),FALSE);
bind_ttm_to_page((GINT)OBJ_GET(widget,"page"));
io_cmd_f("ms2_e_read_toothmon",NULL);
break;
case START_TRIGMON_LOGGER:
ttm_data->stop = FALSE;
OBJ_SET(ttm_data->darea,"io_cmd_function",(gpointer)"ms2_e_read_trigmon");
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget_f("toothlogger_buttons_table")),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget_f("compositelogger_buttons_table")),FALSE);
bind_ttm_to_page((GINT)OBJ_GET(widget,"page"));
io_cmd_f("ms2_e_read_trigmon",NULL);
break;
case START_COMPOSITEMON_LOGGER:
ttm_data->stop = FALSE;
OBJ_SET(ttm_data->darea,"io_cmd_function",(gpointer)"ms2_e_read_compositemon");
alter_widget_state_f(GTK_WIDGET(lookup_widget_f("toothlogger_buttons_table")),NULL);
alter_widget_state_f(GTK_WIDGET(lookup_widget_f("triggerlogger_buttons_table")),NULL);
bind_ttm_to_page((GINT)OBJ_GET(widget,"page"));
io_cmd_f("ms2_e_read_compositemon",NULL);
break;
case STOP_TOOTHMON_LOGGER:
ttm_data->stop = TRUE;
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget_f("triggerlogger_buttons_table")),TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget_f("compositelogger_buttons_table")),TRUE);
break;
case STOP_TRIGMON_LOGGER:
ttm_data->stop = TRUE;
alter_widget_state_f(GTK_WIDGET(lookup_widget_f("toothlogger_buttons_table")),NULL);
alter_widget_state_f(GTK_WIDGET(lookup_widget_f("compositelogger_buttons_table")),NULL);
break;
case STOP_COMPOSITEMON_LOGGER:
ttm_data->stop = TRUE;
alter_widget_state_f(GTK_WIDGET(lookup_widget_f("toothlogger_buttons_table")),NULL);
alter_widget_state_f(GTK_WIDGET(lookup_widget_f("triggerlogger_buttons_table")),NULL);
break;
default:
MTXDBG(CRITICAL,_("Default case reached, i.e. handler not found in global, common or ECU plugins for widget %s, BUG!\n"),glade_get_widget_name(widget));
break;
}
}
EXIT();
return TRUE;
}
开发者ID:JacobD10,项目名称:MegaTunix,代码行数:66,代码来源:ms2_gui_handlers.c
示例3: gauge_motion
gboolean gauge_motion(GtkWidget *widget, GdkEventMotion *event, gpointer data)
{
GtkWidget *x_spin = NULL;
GtkWidget *y_spin = NULL;
GtkWidget *x_o_spin = NULL;
GtkWidget *y_o_spin = NULL;
gfloat x_origin = 0.0;
gfloat y_origin = 0.0;
x_spin = (GtkWidget *)OBJ_GET(widget,"x_spin");
y_spin = (GtkWidget *)OBJ_GET(widget,"y_spin");
if ((!GTK_IS_WIDGET(x_spin)) || (!GTK_IS_WIDGET(y_spin)))
return FALSE;
if ((GBOOLEAN)OBJ_GET(x_spin,"relative"))
{
x_o_spin = (GtkWidget *)OBJ_GET(x_spin,"x_o_spin");
y_o_spin = (GtkWidget *)OBJ_GET(x_spin,"y_o_spin");
x_origin = gtk_spin_button_get_value(GTK_SPIN_BUTTON(x_o_spin));
y_origin = gtk_spin_button_get_value(GTK_SPIN_BUTTON(y_o_spin));
if (GTK_IS_WIDGET(x_spin))
gtk_spin_button_set_value(GTK_SPIN_BUTTON(x_spin),((event->x-(widget->allocation.width/2.0))/(widget->allocation.width/2.0))-x_origin);
if (GTK_IS_WIDGET(y_spin))
gtk_spin_button_set_value(GTK_SPIN_BUTTON(y_spin),((event->y-(widget->allocation.height/2.0))/(widget->allocation.height/2.0))-y_origin);
}
else
{
if (GTK_IS_WIDGET(x_spin))
gtk_spin_button_set_value(GTK_SPIN_BUTTON(x_spin),(event->x-(widget->allocation.width/2.0))/(widget->allocation.width/2.0));
if (GTK_IS_WIDGET(y_spin))
gtk_spin_button_set_value(GTK_SPIN_BUTTON(y_spin),(event->y-(widget->allocation.height/2.0))/(widget->allocation.height/2.0));
}
return TRUE;
}
开发者ID:Torture,项目名称:MegaTunix,代码行数:32,代码来源:events.c
示例4: add_additional_rtt
/*!
\brief add_additional_rtt() is called as a post function for Tab loading
to add an RTT on a normal widget tab. (AE wizard currently)
\param widget, pointer to widget containing the data needed
*/
G_MODULE_EXPORT void add_additional_rtt(GtkWidget *widget)
{
GHashTable *rtt_hash = NULL;
gchar * ctrl_name = NULL;
gchar * source = NULL;
Rt_Text *rt_text = NULL;
gboolean show_prefix = FALSE;
rtt_hash = DATA_GET(global_data,"rtt_hash");
ctrl_name = OBJ_GET(widget,"ctrl_name");
source = OBJ_GET(widget,"source");
show_prefix = (GBOOLEAN)OBJ_GET(widget,"show_prefix");
if (!rtt_hash)
{
rtt_hash = g_hash_table_new_full(g_str_hash,g_str_equal,g_free,dealloc_rtt);
DATA_SET_FULL(global_data,"rtt_hash",(gpointer)rtt_hash,g_hash_table_destroy);
}
if ((rtt_hash) && (ctrl_name) && (source))
rt_text = add_rtt(widget,ctrl_name,source,show_prefix);
if (rt_text)
{
if (!g_hash_table_lookup(rtt_hash,ctrl_name))
g_hash_table_insert(rtt_hash,
g_strdup(ctrl_name),
(gpointer)rt_text);
}
return;
}
开发者ID:seank,项目名称:MegaTunix,代码行数:36,代码来源:runtime_text.c
示例5: close_2d_editor
/*!
\brief Closes a 2-D table editor and deallocates any required resources
\param widget is the 2D table editor window containing the widget list to
be deallocated
\param data is unused
\returns FALSE
*/
G_MODULE_EXPORT gboolean close_2d_editor(GtkWidget * widget, gpointer data)
{
GList *list = NULL;
list = OBJ_GET(widget, "widget_list");
if (list)
{
g_list_foreach(list,remove_widget,NULL);
g_list_free(list);
list = NULL;
}
list = OBJ_GET(widget, "curve_list");
if (list)
{
g_list_foreach(list,clean_curve,NULL);
g_list_free(list);
list = NULL;
}
list = OBJ_GET(widget, "gauge_list");
if (list)
{
g_list_foreach(list,gauge_cleanup,NULL);
g_list_free(list);
list = NULL;
}
gtk_widget_destroy(widget);
return FALSE;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:35,代码来源:2d_table_editor.c
示例6: list_object_sort
gint list_object_sort(gconstpointer a, gconstpointer b, gpointer data)
{
GObject *a1 = (GObject *)a;
GObject *b1 = (GObject *)b;
const gchar *key = (const gchar *)data;
return g_ascii_strcasecmp((gchar *)OBJ_GET(a1,key),(gchar *)OBJ_GET(b1,key));
}
开发者ID:Torture,项目名称:MegaTunix,代码行数:7,代码来源:listmgmt.c
示例7: generic_spin_button_handler
G_MODULE_EXPORT gboolean generic_spin_button_handler(GtkWidget *widget, gpointer data)
{
gfloat tmpf = 0.0;
MtxGaugeFace *g = NULL;
gint handler = 0;
tmpf = (gfloat)gtk_spin_button_get_value((GtkSpinButton *)widget);
if (!OBJ_GET((widget),"handler"))
{
printf("control %s has no handler\n",(gchar *)gtk_widget_get_name(widget));
return FALSE;
}
handler = (GINT)OBJ_GET((widget),"handler");
if (GTK_IS_WIDGET(gauge))
g = MTX_GAUGE_FACE(gauge);
else
return FALSE;
if (hold_handlers)
return TRUE;
changed = TRUE;
mtx_gauge_face_set_attribute(g,handler,tmpf);
if ((handler == UBOUND) || (handler == LBOUND))
update_attributes();
return TRUE;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:27,代码来源:handlers.c
示例8: ecu_std_button_handler
/*!
\brief ECU specific std button handler
\param widget is a pointer to the widget the user modified
\param data is unused
\returns TRUE
*/
G_MODULE_EXPORT gboolean ecu_std_button_handler(GtkWidget *widget, gpointer data)
{
gint handler = 0;
gchar *tmpbuf = NULL;
gfloat tmpf = 0.0;
const gchar *dest = NULL;
ENTER();
handler = (MS2StdHandler)(GINT)OBJ_GET(widget,"handler");
switch ((MS2StdHandler)handler)
{
case GET_CURR_TPS:
tmpbuf = (gchar *)OBJ_GET(widget,"source");
lookup_current_value_f(tmpbuf,&tmpf);
dest = (const gchar *)OBJ_GET(widget,"dest_widget");
tmpbuf = g_strdup_printf("%.0f",tmpf);
gtk_entry_set_text(GTK_ENTRY(lookup_widget_f(dest)),tmpbuf);
g_signal_emit_by_name(lookup_widget_f(dest),"activate",NULL);
g_free(tmpbuf);
break;
default:
MTXDBG(CRITICAL,_("ERROR handler NOT found for widget %s, command aborted! BUG!!!\n"),glade_get_widget_name(widget));
break;
}
EXIT();
return TRUE;
}
开发者ID:JacobD10,项目名称:MegaTunix,代码行数:34,代码来源:ms2_gui_handlers.c
示例9: alter_widget_state
/*!
\brief sets a widget sensitive or insensitive based on the status of
dependant groups
\param key is the pointer to Widget
\param data is unused
*/
G_MODULE_EXPORT void alter_widget_state(gpointer key, gpointer data)
{
GtkWidget * widget = key;
gchar * tmpbuf = NULL;
//const gchar * name = NULL;
gchar ** groups = NULL;
gint num_groups = 0;
gint i = 0;
gboolean value = FALSE;
gboolean state = FALSE;
MatchType type = AND;
GHashTable *widget_group_states = NULL;
if (!GTK_IS_WIDGET(widget))
return;
if (!OBJ_GET(widget,"bind_to_list"))
{
/* Not in a list, then enable it */
gtk_widget_set_sensitive(GTK_WIDGET(widget),TRUE);
/*name = glade_get_widget_name(widget);
MTXDBG(CRITICAL,(_("alter_widget_state(): Error with widget \"%s\", bind_to_list is null\n"),(name == NULL ? "undefined":name)));*/
return;
}
else
tmpbuf = (gchar *)OBJ_GET(widget,"bind_to_list");
widget_group_states = DATA_GET(global_data,"widget_group_states");
if (OBJ_GET(widget,"match_type"))
type = (MatchType)OBJ_GET(widget,"match_type");
groups = parse_keys(tmpbuf,&num_groups,",");
state = TRUE;
/*printf("setting state for %s in groups \"%s\" to:",(gchar *) OBJ_GET(widget,"name"),tmpbuf);*/
for (i=0;i<num_groups;i++)
{
value = (GBOOLEAN)g_hash_table_lookup(widget_group_states,groups[i]);
if (type == AND)
{
if (value == FALSE)
{
state = FALSE;
break;
}
}
else if (type == OR)
{
if (value == TRUE)
{
state = TRUE;
break;
}
else
state = FALSE;
}
}
g_strfreev(groups);
/*printf("%i\n",state);*/
gtk_widget_set_sensitive(GTK_WIDGET(widget),state);
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:65,代码来源:widgetmgmt.c
示例10: gauge_cleanup
/*!
\brief removes the watch that drives the gauge on the 2D editor winddow
\param gauge_ptr is the pointer to the Gauge object
\param data is unused
*/
G_MODULE_EXPORT void gauge_cleanup(gpointer gauge_ptr, gpointer data)
{
gint id = 0;
GtkWidget *widget = (GtkWidget *)gauge_ptr;
if (OBJ_GET(widget, "gauge_id"))
{
id = (GINT)OBJ_GET(widget, "gauge_id");
remove_rtv_watch_f(id);
}
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:15,代码来源:2d_table_editor.c
示例11: alter_tgroup_data
gboolean alter_tgroup_data(GtkWidget *widget, gpointer data)
{
gint index = (GINT)OBJ_GET((widget),"index");
gfloat value = 0.0;
gchar * tmpbuf = NULL;
GdkColor color;
TgField field = (TgField)OBJ_GET(widget,"handler");
if (!GTK_IS_WIDGET(gauge))
return FALSE;
switch (field)
{
case TG_FONT_SCALE:
case TG_LAYER:
case TG_TEXT_INSET:
case TG_MAJ_TICK_INSET:
case TG_MIN_TICK_INSET:
case TG_MAJ_TICK_WIDTH:
case TG_MAJ_TICK_LENGTH:
case TG_MIN_TICK_WIDTH:
case TG_MIN_TICK_LENGTH:
case TG_START_ANGLE:
case TG_SWEEP_ANGLE:
case TG_NUM_MAJ_TICKS:
case TG_NUM_MIN_TICKS:
value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
mtx_gauge_face_alter_tick_group(MTX_GAUGE_FACE(gauge),index,field,(void *)&value);
break;
case TG_MAJ_TICK_COLOR_DAY:
case TG_MAJ_TICK_COLOR_NITE:
case TG_MIN_TICK_COLOR_DAY:
case TG_MIN_TICK_COLOR_NITE:
case TG_TEXT_COLOR_DAY:
case TG_TEXT_COLOR_NITE:
gtk_color_button_get_color(GTK_COLOR_BUTTON(widget),&color);
mtx_gauge_face_alter_tick_group(MTX_GAUGE_FACE(gauge),index,field,(void *)&color);
break;
case TG_FONT:
tmpbuf = g_strdup(gtk_font_button_get_font_name (GTK_FONT_BUTTON(widget)));
tmpbuf = g_strchomp(g_strdelimit(tmpbuf,"0123456789",' '));
mtx_gauge_face_alter_tick_group(MTX_GAUGE_FACE(gauge),index,field,(void *)tmpbuf);
g_free(tmpbuf);
break;
case TG_TEXT:
tmpbuf = g_strdup(gtk_entry_get_text (GTK_ENTRY(widget)));
mtx_gauge_face_alter_tick_group(MTX_GAUGE_FACE(gauge),index,field,(void *)tmpbuf);
g_free(tmpbuf);
default:
break;
}
return TRUE;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:54,代码来源:tgroups.c
示例12: main
int main (int argc, char ** argv )
{
GtkWidget *vbox;
gchar *filename = NULL;
gchar *tmpbuf = NULL;
gchar *dirname = NULL;
GError *error = NULL;
gtk_init (&argc, &argv);
filename = get_file(g_build_filename(DASHDESIGNER_GLADE_DIR,"main.ui",NULL),NULL);
if (filename)
{
toplevel = gtk_builder_new();
if(!gtk_builder_add_from_file(toplevel,filename,&error))
{
g_warning ("Couldn't load builder file: %s", error->message);
g_error_free(error);
exit(-1);
}
g_free(filename);
}
else
{
printf("Can't locate primary ui file!!!!\n");
exit(-1);
}
gtk_builder_connect_signals(toplevel,NULL);
main_window = GTK_WIDGET (gtk_builder_get_object(toplevel,"main_window"));
menu_setup(toplevel);
gtk_window_set_resizable(GTK_WINDOW(main_window),TRUE);
gtk_widget_set_sensitive(OBJ_GET(toplevel,"save_dash_menuitem"),FALSE);
gtk_widget_set_sensitive(OBJ_GET(toplevel,"save_dash_as_menuitem"),FALSE);
gtk_widget_set_sensitive(OBJ_GET(toplevel,"close_dash_menuitem"),FALSE);
retrieve_rt_vars();
gtk_widget_show_all(main_window);
if (argc == 2)
{
tmpbuf = g_get_current_dir();
dirname = g_path_get_dirname(argv[1]);
cwd = g_strconcat(tmpbuf,PSEP,dirname,NULL);
g_free(tmpbuf);
g_free(dirname);
if (g_file_test(argv[1],G_FILE_TEST_IS_REGULAR))
import_dash_xml(argv[1]);
}
gtk_main();
return (0);
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:52,代码来源:main.c
示例13: grab_coords_event
EXPORT gboolean grab_coords_event(GtkWidget *widget, gpointer data)
{
gdouble x = 0.0;
gdouble y = 0.0;
gtk_widget_set_sensitive(OBJ_GET(widget,"x_spin"),FALSE);
gtk_widget_set_sensitive(OBJ_GET(widget,"y_spin"),FALSE);
gtk_widget_set_sensitive(widget,FALSE);
OBJ_SET(gauge,"x_spin",OBJ_GET(widget,"x_spin"));
OBJ_SET(gauge,"y_spin",OBJ_GET(widget,"y_spin"));
OBJ_SET(gauge,"edit_but",widget);
return TRUE;
}
开发者ID:Torture,项目名称:MegaTunix,代码行数:13,代码来源:events.c
示例14: save_default_choices
/*!
\brief Saves the default loggable choices
\param widget is unused
\returns FALSE
*/
G_MODULE_EXPORT gboolean save_default_choices(GtkWidget *widget)
{
GtkWidget *tmpwidget = NULL;
GList * list = NULL;
GList * defaults = NULL;
gconstpointer *object = NULL;
gchar *name = NULL;
gint i = 0;
defaults = get_list("logviewer_defaults");
if (defaults)
{
g_list_foreach(defaults,(GFunc)g_free,NULL);
g_list_free(defaults);
defaults = NULL;
remove_list("logviewer_defaults");
}
list = get_list("viewables");
for (i=0;i<g_list_length(list);i++)
{
tmpwidget = g_list_nth_data(list,i);
object = OBJ_GET(tmpwidget,"object");
if ((GBOOLEAN)DATA_GET(object,"being_viewed"))
{
if (DATA_GET(global_data,"playback_mode"))
name = DATA_GET(object,"lview_name");
else
name = DATA_GET(object,"dlog_gui_name");
defaults = g_list_append(defaults,g_strdup(name));
}
}
store_list("logviewer_defaults",defaults);
return FALSE;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:40,代码来源:logviewer_gui.c
示例15: set_default_lview_choices_state
/*!
\brief set_default_lview_choices_state() sets the default logviewer values
*/
G_MODULE_EXPORT void set_default_lview_choices_state(void)
{
GList *defaults = NULL;
GList *list = NULL;
GtkWidget * widget = NULL;
gint i = 0;
gint j = 0;
gchar * name;
gchar * potential;
gconstpointer *object;
defaults = get_list("logviewer_defaults");
list = get_list("viewables");
for (i=0;i<g_list_length(defaults);i++)
{
name = g_list_nth_data(defaults,i);
for (j=0;j<g_list_length(list);j++)
{
widget = g_list_nth_data(list,j);
object = OBJ_GET(widget,"object");
if (DATA_GET(global_data,"playback_mode"))
potential = DATA_GET(object,"lview_name");
else
potential = DATA_GET(object,"dlog_gui_name");
if (g_strcasecmp(name,potential) == 0)
set_widget_active(GTK_WIDGET(widget),GINT_TO_POINTER(TRUE));
}
}
return;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:34,代码来源:logviewer_gui.c
示例16: ecu_update_combo
/*!
\brief ECU specific plugin handler for combo boxes
\param widget is the pointer to the combo box
\param data is unused
\returns TRUE
*/
G_MODULE_EXPORT gboolean ecu_update_combo(GtkWidget *widget, gpointer data)
{
gfloat value = 0.0;
GtkTreeModel *model = NULL;
GtkTreeIter iter;
JimStimStdHandler handler;
GdkColor white = {0,65535,65535,65535};
handler = (JimStimStdHandler)OBJ_GET(widget,"handler");
if (handler == RPM_MODE)
{
value = convert_after_upload_f(widget);
model = gtk_combo_box_get_model(GTK_COMBO_BOX(widget));
/* If set to 65535, pick second choice, otherwise first one..
*/
gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model),&iter);
if ((GINT)value == 65535)
gtk_tree_model_iter_next (GTK_TREE_MODEL(model), &iter);
g_signal_handlers_block_by_func(widget,(gpointer)std_combo_handler_f,NULL);
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(widget),&iter);
gtk_widget_modify_base(gtk_bin_get_child(GTK_BIN(widget)),GTK_STATE_NORMAL,&white);
g_signal_handlers_unblock_by_func(widget,(gpointer)std_combo_handler_f,NULL);
}
return TRUE;
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:33,代码来源:jimstim_gui_handlers.c
示例17: alter_w_range_data
gboolean alter_w_range_data(GtkWidget *widget, gpointer data)
{
gint index = (GINT)OBJ_GET((widget),"index");
gfloat value = 0.0;
GdkColor color;
WrField field = (WrField)(GINT)data;
if (!GTK_IS_WIDGET(gauge))
return FALSE;
switch (field)
{
case WR_LOWPOINT:
case WR_HIGHPOINT:
case WR_INSET:
case WR_LWIDTH:
value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget));
mtx_gauge_face_alter_warning_range(MTX_GAUGE_FACE(gauge),index,field,(void *)&value);
break;
case WR_COLOR_DAY:
case WR_COLOR_NITE:
gtk_color_button_get_color(GTK_COLOR_BUTTON(widget),&color);
mtx_gauge_face_alter_warning_range(MTX_GAUGE_FACE(gauge),index,field,(void *)&color);
break;
default:
break;
}
return TRUE;
}
开发者ID:BMWPower,项目名称:MegaTunix,代码行数:29,代码来源:warnings.c
示例18: logviewer_button_event
/*!
\brief logviewer generic button event handler
\param widget is the pointer to button
\param data is unused
\returns TRUE
*/
G_MODULE_EXPORT gboolean logviewer_button_event(GtkWidget *widget, gpointer data)
{
Lv_Handler handler;
GtkWidget *tmpwidget = NULL;
handler = (Lv_Handler)(GINT)OBJ_GET(widget,"handler");
switch(handler)
{
case LV_GOTO_START:
tmpwidget = lookup_widget("logviewer_log_position_hscale");
if (GTK_IS_RANGE(tmpwidget))
gtk_range_set_value(GTK_RANGE(tmpwidget),0.0);
break;
case LV_GOTO_END:
tmpwidget = lookup_widget("logviewer_log_position_hscale");
if (GTK_IS_RANGE(tmpwidget))
gtk_range_set_value(GTK_RANGE(tmpwidget),100.0);
break;
case LV_PLAY:
start_tickler(LV_PLAYBACK_TICKLER);
break;
case LV_STOP:
stop_tickler(LV_PLAYBACK_TICKLER);
break;
case LV_REWIND:
printf("rewind\n");
break;
case LV_FAST_FORWARD:
printf("fast forward\n");
break;
default:
break;
}
return TRUE;
}
开发者ID:bigamil,项目名称:MegaTunix,代码行数:41,代码来源:logviewer_events.c
示例19: remove_widget
/*!
\brief removes a widget pointer from the ecu_widgets list
\param widget_ptr is the pointer to the widget to remove
\param data is unused
*/
G_MODULE_EXPORT void remove_widget(gpointer widget_ptr, gpointer data)
{
GList ***ecu_widgets = NULL;
gint page = -1;
gint offset = -1;
ecu_widgets = DATA_GET(global_data,"ecu_widgets");
remove_from_lists_f(OBJ_GET(widget_ptr,"bind_to_list"),widget_ptr);
if (!GTK_IS_ENTRY(widget_ptr))
return;
page = (GINT)OBJ_GET(widget_ptr,"page");
offset = (GINT)OBJ_GET(widget_ptr,"offset");
if (( page >= 0 ) && (offset >= 0))
ecu_widgets[page][offset] = g_list_remove(ecu_widgets[page][offset],widget_ptr);
/*dealloc_widget(widget_ptr,NULL);*/
}
开发者ID:toxicgumbo,项目名称:MegaTunix,代码行数:21,代码来源:2d_table_editor.c
示例20: reset_temps_pf
EXPORT void reset_temps_pf(void)
{
gdk_threads_enter();
set_title(g_strdup(_("Adjusting for local Temp units...")));
reset_temps(OBJ_GET(global_data,"temp_units"));
gdk_threads_leave();
}
开发者ID:Torture,项目名称:MegaTunix,代码行数:7,代码来源:helpers.c
注:本文中的OBJ_GET函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论