maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Design (https://talk.maemo.org/forumdisplay.php?f=46)
-   -   NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA (https://talk.maemo.org/showthread.php?t=73225)

sunus 2011-05-19 06:10

NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
as i said in topic,i wanna make a tiny stuff needs this !
the status area is in the top right of the screen where shows the battery,times,ect..
here's what i did
let's say,the widget is a gtk_button
i know i need to use hd_status_plugin_item_set_status_area_widget (),
but it just can not make it work!

void new_widget_next_to_clock(HDStatusPluginItem *item)
{
GtkWidget *button = gtk_button_new_with_label("hello");
hd_status_plugin_item_set_status_area_widget(HD_ST ATUS_PLUGIN_ITEM(item), button1)
gtk_widget_show_all(item);
}

but , nothing happens.
anyway, i can use hd_status_plugin_item_set_status_area_icon to add a icon in status area , but i cannot add a widget.

here are something i've read :
http://maemo.org/api_refs/5.0/5.0-fi...luginItem.html the APIs

http://maemo.org/development/sdks/maemo_5_examples/ some exapmles

http://maemo.gitorious.org/hildon/hildon the whole code about hildon.

anyone know how?
thx! any answers would be greatly appreaciate!!
thx again!

nicolai 2011-05-19 07:49

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
This only works for the clock statusarea-plugin.
That is why the documentation says:
Quote:

...Sets a widget which should be displayed in the Status Area. This function should only be used by the Clock plugin.
Take a look at the source code of hidon-status-area, on how it
prevents other plugins from adding its own statusarea widgets.

And take a look at
status-menu.plugins:

X-Status-Area-Permanent-Item=Clock

sunus 2011-05-19 08:19

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
Quote:

Originally Posted by nicolai (Post 1009735)
This only works for the clock statusarea-plugin.
That is why the documentation says:


Take a look at the source code of hidon-status-area, on how it
prevents other plugins from adding its own statusarea widgets.

And take a look at
status-menu.plugins:

X-Status-Area-Permanent-Item=Clock

yep,
i noticed "This function should only be used by the Clock plugin." already.
and i am looking for the hidon-status-area source code , but i didn't find anything useful.
and i also looking for the codes that implements the clock plugins.
can u provide some links ? thx thx!!

sunus 2011-05-19 08:29

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
Now, all i can do is waiting for your answer :D
i've finished my code on the Widget yesterday.
ALL I NEED TO DO IS how to add it to the status area!
thx pal!

sunus 2011-05-19 08:37

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
now i got the
hildon-status-menu-0.3.39+0m5 source..
and i am reading it.
but still need your advices! thank you

nicolai 2011-05-19 08:39

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
Well, the source code for the fremantle hildon-desktop is
open source. You can find it in maemos gitorious repository:
http://maemo.gitorious.org/fremantle...on-status-menu

The builtin clock plugin isn't open.

nicolai

sunus 2011-05-19 08:53

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
Quote:

Originally Posted by nicolai (Post 1009775)
Well, the source code for the fremantle hildon-desktop is
open source. You can find it in maemos gitorious repository:
http://maemo.gitorious.org/fremantle...on-status-menu

The builtin clock plugin isn't open.

nicolai

i am reading it .
thx
btw : is my demand implement-able if i don't know how they add a clock plugin ? let's say , add a button with label 'hello' right next to the clock.

nicolai 2011-05-19 09:21

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
I don't know if it is possible to add another
widget. Maybe you can only replace the
clock plugin.

sunus 2011-05-19 18:43

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
Quote:

Originally Posted by nicolai (Post 1009810)
I don't know if it is possible to add another
widget. Maybe you can only replace the
clock plugin.

dman it! i've tried another way
that is:
i convert all the characters to a image ,
and i use
hd_status_plugin_item_set_status_area_icon()
to add them , one by one
but, but! i find a problem!
the image i added is size-fixed to 16x16
but what i want is 16x32!!

i know the icon_theme has something to do with it
but i do know how to set a size for the image to be added in status.
i got a screen for you,to make my point clear.
http://farm6.static.flickr.com/5030/...ef83a52ce4.jpg
i want the img number 9 has the size of 16widthx32hight
simple change the size parameter of gtk_icon_theme_load_icon DOESN'T WORK!!

thx for your time!!
ps : if the img doesn't show up,
u can visite this link
http://www.flickr.com/photos/6006428...in/photostream
just in case! thank man!

sunus 2011-05-19 18:48

Re: NEED HELp ! creat a GtkWidget right next to the CLOCK in STATUS AREA
 
as far as i know
the spaces right next to the clock is something like this

img1 img2
img3 img4 img's size = 16x16

so,i figure if i get this img as hight as tow img.i can make somthing like this

im im im im
g1 g2 g3 g4 img's size=16x32

hope u understand this,
because if i use the default size(16x16)
the order of imgs will be messed up!

have a good day and i need to get some sleep now!
hope to get ur answers!


All times are GMT. The time now is 10:46.

vBulletin® Version 3.8.8