|
Post by ptitjoz on Jan 21, 2021 20:50:24 GMT 1
Hello is it possible to put a background color in the main window (WINDOW Widget)? Best regards
|
|
|
Post by Pjot on Jan 22, 2021 9:43:48 GMT 1
Hi ptitjoz, The same question came up before, like here. HTH Peter
|
|
|
Post by ptitjoz on Jan 22, 2021 11:46:52 GMT 1
Hello Peter Thank you for your answer
I added these lines:
lib$ = HUGLIB$("gtk") IMPORT "gtk_widget_modify_bg(long,int,long)" FROM lib$ TYPE void
and
gtk_widget_modify_bg(Win1,0,"green")
The color changes well but does not match Small note, in the documentation, it says that this command is deprecated.
But how to use it?
Regards
|
|
|
Post by Pjot on Jan 23, 2021 9:07:48 GMT 1
Hi ptitjoz, Looking at your last questions in the several posts, it seems that you require a more sophisticated usage for HUG. So it may be better for you to use GTK directly, outside the HUG context. You can check and rip the code from HUG for a quick start. Please realize that HUG is a limited framework, which allows you to quickly create a basic GUI. It does not have advanced features. It would be even better to use BaCon's native GUI functions, which are designed to approach a graphical toolkit like GTK in a abstract manner. Having said that, below a simple example of how to set a color of a window. You can find this code in HUG also. INCLUDE hug
lib$ = HUGLIB$("gtk")
IMPORT "gtk_widget_modify_bg(long,int,long)" FROM lib$ TYPE void ALIAS BGCOLOR
win = WINDOW("Hello world", 200, 200)
gdkcol = g_malloc(HUG_DEFAULT_WIDGET_SIZE) gdk_color_parse("#00FF00", gdkcol)
BGCOLOR(win, 0, gdkcol)
DISPLAY The 'gtk_widget_modify_bg' function is deprecated for GTK3. However, HUG is based on GTK2 so never mind that remark in their documentation. Also, please note that this forum is meant to support BaCon. For specific questions about how to use GTK2, please refer to their documentation or wiki. HTH Peter
|
|
|
Post by ptitjoz on Jan 24, 2021 18:50:24 GMT 1
Hello Thank you for your answers. Sorry if my questions were basic and maybe bothering you. Best regards
|
|
|
Post by Pjot on Jan 25, 2021 19:49:50 GMT 1
Sorry if my questions were basic and maybe bothering you. Bonsoir ptitjoz, Obviously you are not bothering the forum Any question related to BaCon is welcome, how basic it may be. So do not hesitate to keep asking questions! But outside BaCon the forum has its limitations Cordialement, Peter
|
|
|
Post by ptitjoz on Feb 5, 2021 9:59:27 GMT 1
Hello yes I understand your answer. My problem is that I know English very poorly and I don't know much about Linux and gtk. But have no fear, I will be asking more questions or giving you suggestions on Bacon. Best regards
|
|