Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-09-06 16:14:01

d0u9
Member
Registered: 2016-09-06
Posts: 5

How to change the size of panel plugin.

I write one simple xfce panel plugin for studying plugin development. This test plugin just displays one button widget labelled as "Hello World":

#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-plugin.h>

static void system_monitor_construct(XfcePanelPlugin *plugin);
XFCE_PANEL_PLUGIN_REGISTER(system_monitor_construct);


static void hello( GtkWidget *widget,
                   gpointer   data )
{
    g_print ("Hello World\n");
}

static void system_monitor_construct(XfcePanelPlugin *plugin)
{
	GtkWidget *button;

	button = gtk_button_new_with_label ("Hello World");
	g_signal_connect (button, "clicked", G_CALLBACK (hello), NULL);
	gtk_container_add (GTK_CONTAINER (plugin), button);
	gtk_widget_show (button);
}

However, when this plugin is loaded, only part of string "Hello World" is displayed, like this:

Screenshot%20-%2009072016%20-%2012%3A09%3A26%20AM.png

How could I enlarge panel plug to display full contents?

Thanks!

Last edited by d0u9 (2016-09-06 16:14:27)

Offline

#2 2016-09-06 16:51:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to change the size of panel plugin.

Your code seems to work fine here:
panel16.png

What version of Xfce and xfce4-panel are you using?

Try creating a new panel with no items on it other than yours and see if works better (its hard to tell from your image what else is on the panel)?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-09-06 17:05:52

d0u9
Member
Registered: 2016-09-06
Posts: 5

Re: How to change the size of panel plugin.

I build this plugin on xfce4.10, shipped with Debian 8 Jessie.

This is a fresh installed OS, and I do create one empty panel and test this plugin there.

below is full size screen shot:

debian807092016010347.png

ToZ wrote:

Your code seems to work fine here:
http://en.zimagez.com/miniature/panel16.png

What version of Xfce and xfce4-panel are you using?

Try creating a new panel with no items on it other than yours and see if works better (its hard to tell from your image what else is on the panel)?

Offline

#4 2016-09-06 21:19:27

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: How to change the size of panel plugin.

Well, I checked Xfce 4.11 and it worked. Then I loaded Debian 8.5 Jessie (Xfce 4.10.1) into a VM and confirmed that I am seeing the same as you. I would guess that there is something in the 4.10 code that prevents (or doesn't support) non-square buttons that was fixed/added in a later release.

You might want to send a note to the xfce4-dev mailing list to see if one of the developers has a better idea of what is happening here.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB