2015-08-28 09:01:57 -05:00
|
|
|
// 16 august 2015
|
2015-06-11 18:23:47 -05:00
|
|
|
#include "uipriv_unix.h"
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
static void defaultCommitShow(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_show(GTK_WIDGET(uiControlHandle(c)));
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
static void defaultCommitHide(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_hide(GTK_WIDGET(uiControlHandle(c)));
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
void osCommitEnable(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(uiControlHandle(c)), TRUE);
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
void osCommitDisable(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(uiControlHandle(c)), FALSE);
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
|
|
|
|
2015-08-28 09:01:57 -05:00
|
|
|
void uiUnixFinishControl(uiControl *c)
|
2015-06-11 18:23:47 -05:00
|
|
|
{
|
2015-08-28 09:01:57 -05:00
|
|
|
g_object_ref_sink(GTK_WIDGET(uiControlHandle(c)));
|
|
|
|
if (!isToplevel(c))
|
|
|
|
gtk_widget_show(GTK_WIDGET(uiControlHandle(c)));
|
|
|
|
c->CommitShow = defaultCommitShow;
|
|
|
|
c->CommitHide = defaultCommitHide;
|
2015-06-11 18:23:47 -05:00
|
|
|
}
|
2016-04-24 15:59:46 -05:00
|
|
|
|
|
|
|
#define uiUnixControlSignature 0x556E6978
|
|
|
|
|
|
|
|
uiUnixControl *uiUnixNewControl(size_t n, uint32_t typesig, const char *typename)
|
|
|
|
{
|
|
|
|
return uiUnixControl(newControl(n, uiUnixControlSignature, typesig, typename));
|
|
|
|
}
|