Sorry!
Of course it was a mistake (taken from an older demo and forgot to remove the GtkScrolledWindow in which all Gadget-Types was placed to debug the structure)
The hierarchy above has been corrected!
Now the 1. button should be visible ...
Code: Select all
ImportC ""
gtk_widget_get_name(*widget.GtkWidget)
EndImport
Define.i win, FixedBox, widget
win = OpenWindow(#PB_Any, 0, 0, 400, 300, "Test", #PB_Window_SystemMenu)
;GtkWindow > GtkVBox > GtkScrolledWindow > GtkViewport > GtkFixed > GtkScrolledWindow > GtkViewport > GtkFixed >
;gtk3
; FixedBox = g_list_nth_data_(gtk_container_get_children_(WindowID(win)), 0) ;GtkVBox
; Debug PeekS(gtk_widget_get_name(FixedBox), -1, #PB_UTF8)
; FixedBox = g_list_nth_data_(gtk_container_get_children_(FixedBox), 0) ;GtkScrolledWindow
; Debug PeekS(gtk_widget_get_name(FixedBox), -1, #PB_UTF8)
; FixedBox = g_list_nth_data_(gtk_container_get_children_(FixedBox), 0) ;GtkViewport
; Debug PeekS(gtk_widget_get_name(FixedBox), -1, #PB_UTF8)
; FixedBox = g_list_nth_data_(gtk_container_get_children_(FixedBox), 0) ;GtkFixed WORKS
; Debug PeekS(gtk_widget_get_name(FixedBox), -1, #PB_UTF8)
; Debug FixedBox
;gtk2
FixedBox = g_list_nth_data_(gtk_container_get_children_(WindowID(win)), 0) ;GtkVBox
Debug PeekS(gtk_widget_get_name(FixedBox), -1, #PB_UTF8)
FixedBox = g_list_nth_data_(gtk_container_get_children_(FixedBox), 0) ;GtkFixed ;ERROR
Debug PeekS(gtk_widget_get_name(FixedBox), -1, #PB_UTF8)
Debug FixedBox
widget = gtk_button_new_with_label_("TEST")
gtk_fixed_put_(fixedBox, widget, 0, 0)
gtk_widget_show_(widget)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
ps: To avoid problems in the future ...
For all API commands which uses parameters which are not of the type integer or long, you should use 'ImportC' with the proper types. Here ...
Code: Select all
ImportC ""
gtk_button_new_with_label(text.p-utf8)
EndImport
Only a few non-integer-parameters was adapted correctly in the PB API calls.