window.c: first hello in a box

This commit is contained in:
Jean Sirmai 2023-11-29 14:51:01 +01:00
parent d3a64462db
commit d353bf1188
Signed by: jean
GPG Key ID: FB3115C340E057E3
4 changed files with 31 additions and 17 deletions

View File

@ -128,3 +128,5 @@ void onTreeViewRowActivated (GtkTreeView *view, GtkTreePath *path,
void tree_c_test(void); void tree_c_test(void);
GtkWidget *create_tree_label(void);

View File

@ -32,8 +32,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
tree_c_test();
g_autoptr(GemGraphClientApplication) app = NULL; g_autoptr(GemGraphClientApplication) app = NULL;
int res; int res;

View File

@ -81,15 +81,6 @@
<property name="child"> <property name="child">
<object class="GtkBox" id="runlib_objects"> <object class="GtkBox" id="runlib_objects">
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label_runlib_objects">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;Here must be a label (then a tree)&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="margin-top">50</property>
<property name="margin-bottom">50</property>
</object>
</child>
</object> </object>
</property> </property>
</object> </object>

View File

@ -119,12 +119,22 @@ void ui_set_stack(const char *mode)
// Switch on the first letter of the mode, because switch is soooo simple :) // Switch on the first letter of the mode, because switch is soooo simple :)
switch(mode[0]) { switch(mode[0]) {
case 'e': gtk_menu_button_set_icon_name(window->main_button_mode, "document-edit-symbolic"); break; case 'e':
case 'r': gtk_menu_button_set_icon_name(window->main_button_mode, "system-run-symbolic"); break; gtk_menu_button_set_icon_name(window->main_button_mode, "document-edit-symbolic");
case 'p': gtk_menu_button_set_icon_name(window->main_button_mode, "x-office-presentation-symbolic");break; break;
case 'h': gtk_paned_set_position(window->main_paned, 0); case 'r':
gtk_menu_button_set_icon_name(window->main_button_mode, "user-home-symbolic"); break; gtk_menu_button_set_icon_name(window->main_button_mode, "system-run-symbolic");
default: break; create_tree_label();
break;
case 'p':
gtk_menu_button_set_icon_name(window->main_button_mode, "x-office-presentation-symbolic");
break;
case 'h':
gtk_paned_set_position(window->main_paned, 0);
gtk_menu_button_set_icon_name(window->main_button_mode, "user-home-symbolic");
break;
default:
break;
} }
} }
@ -220,3 +230,16 @@ void ui_toggle_sidebar(void)
else gtk_paned_set_position(window->main_paned, 400); else gtk_paned_set_position(window->main_paned, 400);
} }
GtkWidget *create_tree_label(void)
{
GtkWidget *label, *slider;
GtkAdjustment *adj;
const char *text = "HELLO !";
label = gtk_label_new(text);
gtk_box_append(GTK_BOX(window->runlib_objects), label);
gtk_widget_show(label);
return label;
}