GTK - Some GTK Questions...
GTK - Some GTK Questions...
Hi,
Question #1 :
i find the solution to Set Window Color with the funciton "gtk_widget_modify_bg_" but how can i get this color ?
Thank you for advance
Question #1 :
i find the solution to Set Window Color with the funciton "gtk_widget_modify_bg_" but how can i get this color ?
Thank you for advance
Question #1 :
You can use gtk_widget_get_modifier_style(), modify the 'bg' member of the GtkRcStyle struct with your GdkColor then call gtk_widget_modify_style() passing the new GtkRcStyle.
Question #2 :
* set the position : gtk_widget_set_uposition() , works only for a widget outside a container.
* modifiy the size : gtk_widget_set_size_request ()
You can use gtk_widget_get_modifier_style(), modify the 'bg' member of the GtkRcStyle struct with your GdkColor then call gtk_widget_modify_style() passing the new GtkRcStyle.
Question #2 :
* set the position : gtk_widget_set_uposition() , works only for a widget outside a container.
* modifiy the size : gtk_widget_set_size_request ()
Question 1 :
GtkRcStyle, gtk is a crossplateform toolkit, this is the same struct for all OSes supported
Question 2 :
The easier way is to add a GtkTable to a box then pack your widget in a cell of the table.
You can then play with the space before and/or after the cell.
GtkRcStyle, gtk is a crossplateform toolkit, this is the same struct for all OSes supported
Question 2 :
The easier way is to add a GtkTable to a box then pack your widget in a cell of the table.
You can then play with the space before and/or after the cell.
http://developer.gnome.org/doc/API/2.0/ ... Fixed.htmlFor most applications, you should not use this container! It keeps you from having to learn about the other GTK+ containers, but it results in broken applications. With GtkFixed, the following things will result in truncated text, overlapping widgets, and other display bugs:
*
Themes, which may change widget sizes.
*
Fonts other than the one you used to write the app will of course change the size of widgets containing text; keep in mind that users may use a larger font because of difficulty reading the default, or they may be using Windows or the framebuffer port of GTK+, where different fonts are available.
*
Translation of text into other languages changes its size. Also, display of non-English text will use a different font in many cases.
In addition, the fixed widget can't properly be mirrored in right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+ will flip the interface to put labels to the right of the thing they label, but it can't do that with GtkFixed. So your application will not be usable in right-to-left languages.
Finally, fixed positioning makes it kind of annoying to add/remove GUI elements, since you have to reposition all the other elements. This is a long-term maintenance problem for your application.
Question 1 :

Question 2 :
Yep, but i know that GtkRcStyle must be already declared in the linux version so I want to get these declarationsKarLKoX wrote:GtkRcStyle, gtk is a crossplateform toolkit, this is the same struct for all OSes supported
Question 2 :
What is better : GtkTable or GtkFixed for easy moving and sizing ?KarLKoX wrote:The easier way is to add a GtkTable to a box then pack your widget in a cell of the table.
You can then play with the space before and/or after the cell.
Based on the documentation, GtkTable. As to which is simpler, I'd say GtkFixed as long as you can live with the potential "gotcha's".Progi1984 wrote: What is better : GtkTable or GtkFixed for easy moving and sizing ?
Not to hijack this thread, but what does PB-Linux use?
AIR.
"Programming is like Poetry. Sometimes the words just escape you..." -me, to my manager.
Question 1 :
Noone has the declaration of GtkRcStyle under Linux ?
Question 2 :
I finally use a GTKTable and that works... easily
Question 3 :
New Question : I load an image (always under Windows) with LoadImage. How can i draw this image in a GtkImage ?
Or How can I transform a hBitmap in GdkPixmap ?
Noone has the declaration of GtkRcStyle under Linux ?
Question 2 :
I finally use a GTKTable and that works... easily
Question 3 :
New Question : I load an image (always under Windows) with LoadImage. How can i draw this image in a GtkImage ?
Or How can I transform a hBitmap in GdkPixmap ?
1:
Code: Select all
Structure GtkRcStyle
parent_instance.GObject
*name.b
*bg_pixmap_name.b[5]
*font_desc.PangoFontDescription
color_flags.l[5]
fg.GdkColor[5]
bg.GdkColor[5]
text.GdkColor[5]
base.GdkColor[5]
xthickness.l
ythickness.l
*rc_properties.GArray
*rc_style_lists.GSList
*icon_factories.GSList
PackedFlags.l
EndStructurePureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Question 1:
ts-soft : Sorry to worry you again :
Can you give the declaration of :
Thank you for advance 
ts-soft : Sorry to worry you again :
Can you give the declaration of :
Code: Select all
-GObject
-PangoFontDescription
-GdkColor
-GArray
-GSList
With the freak solution (very good solution : Thanks for it !),
The question #1 & #2 are solved. But the question #3 is always in stand by.
Question 3 :
New Question : I load an image (always under Windows) with LoadImage. How can i draw this image in a GtkImage ?
Or How can I transform a hBitmap in GdkPixmap ?
The question #1 & #2 are solved. But the question #3 is always in stand by.
Question 3 :
New Question : I load an image (always under Windows) with LoadImage. How can i draw this image in a GtkImage ?
Or How can I transform a hBitmap in GdkPixmap ?




