Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » GTK theming a reality
Re: GTK theming a reality [message #6839 is a reply to message #6838] Thu, 30 November 2006 21:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
(now in uppsrc, thanks guido).

Mirek
Re: GTK theming a reality [message #6840 is a reply to message #6839] Thu, 30 November 2006 21:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
BTW, I am just trying to get icons, but there is strange problem:

I am getting only the sort of alpha channel (no colors and perhaps that alpha is one of channels).

Code fragments used are:

		ImageDraw iw(cx + 2 * margin, cy + 2 * margin);
		iw.DrawRect(0, 0, cx + 2 * margin, cy + 2 * margin, back);
		static G_obj *cm = GDK().gdk_x11_colormap_foreign_new(
			GDK().gdkx_visual_get(XVisualIDFromVisual(Xvisual)), Xcolormap);
		G_obj *gw = GDK().gdk_pixmap_foreign_new(iw.GetDrawable());
		GDK().gdk_drawable_set_colormap(gw, cm);


(above is common for painting widget elements too, so there most likely is not problem).

				G_obj *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);


(I am iterating state and shadow using several values to investigate the issue, all of them are just alphas...)

Any ideas?

Mirek
Re: GTK theming a reality [message #6841 is a reply to message #6840] Thu, 30 November 2006 22:45 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
luzr wrote on Thu, 30 November 2006 21:58

				G_obj *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);


Looking into the API docs, it should be:
				GdkPixbuf *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);

and widget has to be != NULL, but I think this is the case. Otherwise one should call gdk_drawable_set_colormap() on b again.

Matthias
Re: GTK theming a reality [message #6842 is a reply to message #6841] Thu, 30 November 2006 22:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
As I am basically redefining the whole interface in U++/.dli and I am using it in just single .cpp file, I have simplified it by "merging" all GTK/GDK/GOBJ pointer types into single one - G_obj (defined in U++).

Mirek
Re: GTK theming a reality [message #6843 is a reply to message #6841] Thu, 30 November 2006 22:54 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
masu wrote on Thu, 30 November 2006 16:45

luzr wrote on Thu, 30 November 2006 21:58

				G_obj *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);


Looking into the API docs, it should be:
				GdkPixbuf *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);

Otherwise one should call gdk_drawable_set_colormap() on b again.

Matthias


Afaik, GdkPixbuf is not drawable...

Mirek
Re: GTK theming a reality [message #6844 is a reply to message #6843] Thu, 30 November 2006 23:07 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
luzr wrote on Thu, 30 November 2006 22:54

Afaik, GdkPixbuf is not drawable...

Mirek

Yes, you are right, as usual Wink.

Matthias
Re: GTK theming a reality [message #6871 is a reply to message #6830] Sat, 02 December 2006 10:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
When I set the font size to "8", the font is different in U++ and Ubuntu. Therefore I tried to alter the code to

	Draw::SetStdFont(Font(fontname, (fontheight * xdpi + 512*72) / (1024*72)));



(rounding the value). This seems to work OK for me, please check with your platforms...

Mirek
Re: GTK theming a reality [message #6878 is a reply to message #6871] Sun, 03 December 2006 00:16 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
This is ok for on my system Smile .
BTW, what was the problem with the pixbuf.

Edit: Size is ok, but I always get default font Arial.

Matthias

[Updated on: Sun, 03 December 2006 00:30]

Report message to a moderator

Re: GTK theming a reality [message #6883 is a reply to message #6878] Sun, 03 December 2006 12:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
masu wrote on Sat, 02 December 2006 18:16


BTW, what was the problem with the pixbuf.



"prototype" widget was set into "insensitive" state for some reason (most likely as result of fact that our hacking of GTK to make it display things for us is really very fragile). Therefore it returned "insensitive" map.

Quote:


Edit: Size is ok, but I always get default font Arial.



What font have you set? (Just name).

Mirek
Re: GTK theming a reality [message #6887 is a reply to message #6883] Sun, 03 December 2006 15:17 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
luzr wrote on Sun, 03 December 2006 12:44

What font have you set? (Just name).

It is simply called "Sans", but it does matter what font I choose, it is always Arial in theIDE even after restarting theIDE.

Matthias


931b81e7ea53320dccc37375b34b38c3
Re: GTK theming a reality [message #6890 is a reply to message #6887] Sun, 03 December 2006 16:37 Go to previous messageGo to next message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
masu wrote on Sun, 03 December 2006 15:17

luzr wrote on Sun, 03 December 2006 12:44

What font have you set? (Just name).

It is simply called "Sans", but it does matter what font I choose, it is always Arial in theIDE even after restarting theIDE.

Matthias


Indeed, going DejaVu Sans -> DejaVu Serif for the GTK default font has no effect on upp apps Confused

Guido
Re: GTK theming a reality [message #6950 is a reply to message #6890] Tue, 05 December 2006 19:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12055
Registered: November 2005
Ultimate Member
Font name issue fixed.

Mirek
Re: GTK theming a reality [message #6952 is a reply to message #6950] Tue, 05 December 2006 20:48 Go to previous messageGo to next message
iplayfast is currently offline  iplayfast
Messages: 47
Registered: February 2006
Member
In Draw/Draw.h there are some case sensitive issues for Linux compiles.

#define DLIMODULE GTK
#define DLIHEADER <draw/gtk.dli>
#include <Core/dli_header.h>

#define DLIMODULE GDK
#define DLIHEADER <draw/gdk.dli>
#include <Core/dli_header.h>

#define DLIMODULE GOBJ
#define DLIHEADER <draw/gobj.dli>
#include <Core/dli_header.h>


should be

#define DLIMODULE GTK
#define DLIHEADER <Draw/gtk.dli>
#include <Core/dli_header.h>

#define DLIMODULE GDK
#define DLIHEADER <Draw/gdk.dli>
#include <Core/dli_header.h>

#define DLIMODULE GOBJ
#define DLIHEADER <Draw/gobj.dli>
#include <Core/dli_header.h>
Re: GTK theming a reality [message #6953 is a reply to message #6952] Tue, 05 December 2006 21:27 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
This should have already been resolved.
Please see prior posts

http://www.arilect.com/upp/forum/index.php?t=msg&&th =1707&goto=6769#msg_6769
and
http://www.arilect.com/upp/forum/index.php?t=msg&&th =1707&goto=6771#msg_6771

Matthias
Re: GTK theming a reality [message #6954 is a reply to message #6953] Tue, 05 December 2006 21:37 Go to previous messageGo to next message
iplayfast is currently offline  iplayfast
Messages: 47
Registered: February 2006
Member
Well I downloaded last night from the dupp-developent 611-dev4 (from Nov 27) and this was the problem I ran into. It's easy to check for yourself.
Re: GTK theming a reality [message #6956 is a reply to message #6954] Tue, 05 December 2006 21:58 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
I see, then it was overlapped action.
At least the uvs version is fixed Smile.

Matthias
Re: GTK theming a reality [message #6997 is a reply to message #6950] Wed, 06 December 2006 23:02 Go to previous message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
luzr wrote on Tue, 05 December 2006 19:56

Font name issue fixed.

Thanks, looks very nice, now Very Happy .

Matthias
Previous Topic: TrayIcon Win32 fixed some misbehaviour....
Next Topic: New Vector optimization reduces Linux executable size by 0.8%
Goto Forum:
  


Current Time: Mon Oct 21 21:58:47 CEST 2019

Total time taken to generate the page: 0.01145 seconds