hello all,
I'm looking for how to modify status bar and its fields with API.
Have someone some clues or code ?
GTK+ Api & StatusBar
it would be very interesting, how Fred has implemented this in PB.
The GTK status bar itself only supports (AFAIK) one field.. this can be modified with
my guess is that the parent of the statusbar is an vbox and therefore you can add textfields (or every other widget!) to this vbox if you know it's handle .... (I think, that is the way it's implemented in PB)
i will verify this in the evening (no time atm) at home ....
The GTK status bar itself only supports (AFAIK) one field.. this can be modified with
Code: Select all
gtk_statusbar_push ()
gtk_statusbar_pop()
gtk_statusbar_remove ()
i will verify this in the evening (no time atm) at home ....
...as I thought ... and a gtk_fixed - I guess - as otherwise no fixed length of the statusbarfields are possible...? anyway
as I found out, CreateStatusbar() returns the ID of the vbox ... so its extremely easy to create a statusbar containing all types of widgets....
a small example:
as I found out, CreateStatusbar() returns the ID of the vbox ... so its extremely easy to create a statusbar containing all types of widgets....
a small example:
Code: Select all
Procedure to_utf8(txt.s)
mem=AllocateMemory(Len(txt)*6)
PokeS(mem,txt,-1,#PB_UTF8)
ProcedureReturn mem
EndProcedure
OpenWindow(0,0,0,500,500,"statusbar-test",#PB_Window_SystemMenu)
st=CreateStatusBar(0,WindowID(0))
*button2 = gtk_button_new_();
gtk_widget_show_(*button2);
gtk_box_pack_start_(st, *button2, #False, #False, 0);
gtk_button_set_relief_(*button2, #GTK_RELIEF_NONE);
icon=to_utf8("gtk-media-play")
*image7 = gtk_image_new_from_stock_(icon, #GTK_ICON_SIZE_MENU);
FreeMemory(icon)
gtk_widget_show_(*image7);
gtk_container_add_(*button2, *image7);
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow



