Commit e62f5038 authored by claes's avatar claes

Timer added

parent 84314bd3
/*
* Proview $Id: xtt_methodtoolbar_gtk.cpp,v 1.2 2007-03-20 12:39:15 claes Exp $
* Proview $Id: xtt_methodtoolbar_gtk.cpp,v 1.3 2007-10-18 12:46:35 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -36,6 +36,12 @@ XttMethodToolbarGtk::XttMethodToolbarGtk( XNav *xnav) :
}
}
XttMethodToolbarGtk::~XttMethodToolbarGtk()
{
if ( m_timerid)
g_source_remove( m_timerid);
}
void XttMethodToolbarGtk::activate_button( GtkWidget *w, gpointer data)
{
XttMethodToolbarGtk *mt = ((xtt_sMethodButtonCb *)data)->mt;
......@@ -84,6 +90,23 @@ GtkWidget *XttMethodToolbarGtk::build()
}
void XttMethodToolbarGtk::set_sensitive()
{
if ( m_timerid)
g_source_remove( m_timerid);
m_timerid = g_timeout_add( 400, set_sensitive_cb, this);
}
gboolean XttMethodToolbarGtk::set_sensitive_cb( void *data)
{
XttMethodToolbarGtk *toolbar = (XttMethodToolbarGtk *)data;
toolbar->m_timerid = 0;
toolbar->set_current_sensitive();
return FALSE;
}
void XttMethodToolbarGtk::set_current_sensitive()
{
int is_attr;
pwr_sAttrRef aref;
......
/*
* Proview $Id: xtt_methodtoolbar_gtk.h,v 1.1 2007-01-17 06:18:10 claes Exp $
* Proview $Id: xtt_methodtoolbar_gtk.h,v 1.2 2007-10-18 12:46:35 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -34,12 +34,16 @@ class XttMethodToolbarGtk : public XttMethodToolbar {
GtkWidget *m_toolbar_w;
GtkWidget *m_button_w[m_size];
xtt_sMethodButtonCb m_cb[m_size];
gint m_timerid;
XttMethodToolbarGtk( XNav *xnav);
~XttMethodToolbarGtk();
GtkWidget *build();
void set_sensitive();
void set_current_sensitive();
static void activate_button( GtkWidget *w, gpointer data);
static gboolean set_sensitive_cb( void *data);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment